diff options
author | Roman Klauke <romaaan.git@gmail.com> | 2015-12-06 15:39:45 +0100 |
---|---|---|
committer | Roman Klauke <romaaan.git@gmail.com> | 2015-12-06 15:39:45 +0100 |
commit | bcc53edda434f97097f019d03c12a9e6fd2d606d (patch) | |
tree | 3b0766e213478b48a0968eedbc96d4df878a9d2b | |
parent | 7d9a6a8397d413ab9e5d7c0fb8409093a45fcb2d (diff) | |
download | servo-bcc53edda434f97097f019d03c12a9e6fd2d606d.tar.gz servo-bcc53edda434f97097f019d03c12a9e6fd2d606d.zip |
move FocusType enum to the script crate
This commit moves the FocusType enum to the script crate and replaces
all usages with the new `usage`.
Fixes #8840
-rw-r--r-- | components/msg/constellation_msg.rs | 7 | ||||
-rw-r--r-- | components/script/dom/document.rs | 9 | ||||
-rw-r--r-- | components/script/dom/htmlelement.rs | 3 | ||||
-rw-r--r-- | components/script/script_task.rs | 4 |
4 files changed, 11 insertions, 12 deletions
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index d7ff06de6a4..b0604e731bf 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -213,13 +213,6 @@ bitflags! { } } -/// Specifies the type of focus event that is sent to a pipeline -#[derive(Copy, Clone, PartialEq)] -pub enum FocusType { - Element, // The first focus message - focus the element itself - Parent, // Focusing a parent element (an iframe) -} - /// Specifies the information required to load a URL in an iframe. #[derive(Deserialize, Serialize)] pub struct IframeLoadInfo { diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 35a668ca196..7b375e34129 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -84,7 +84,7 @@ use msg::compositor_msg::ScriptToCompositorMsg; use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; use msg::constellation_msg::{AnimationState, PipelineId}; -use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyModifiers, KeyState}; +use msg::constellation_msg::{ConstellationChan, Key, KeyModifiers, KeyState}; use msg::constellation_msg::{MouseButton, MouseEventType, MozBrowserEvent, SubpageId}; use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl}; use net_traits::CookieSource::NonHTTP; @@ -2493,3 +2493,10 @@ impl Runnable for DocumentProgressHandler { } } } + +/// Specifies the type of focus event that is sent to a pipeline +#[derive(Copy, Clone, PartialEq)] +pub enum FocusType { + Element, // The first focus message - focus the element itself + Parent, // Focusing a parent element (an iframe) +} diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 4b5fb69cf88..8d4d0c5f457 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -17,7 +17,7 @@ use dom::bindings::inheritance::{ElementTypeId, HTMLElementTypeId, NodeTypeId}; use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference}; use dom::bindings::reflector::Reflectable; use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration}; -use dom::document::Document; +use dom::document::{Document, FocusType}; use dom::domstringmap::DOMStringMap; use dom::element::{AttributeMutation, Element}; use dom::eventtarget::EventTarget; @@ -30,7 +30,6 @@ use dom::node::{Node, SEQUENTIALLY_FOCUSABLE}; use dom::node::{document_from_node, window_from_node}; use dom::nodelist::NodeList; use dom::virtualmethods::VirtualMethods; -use msg::constellation_msg::FocusType; use selectors::states::*; use std::ascii::AsciiExt; use std::borrow::ToOwned; diff --git a/components/script/script_task.rs b/components/script/script_task.rs index eb90805daac..bbc95b79a23 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -31,7 +31,7 @@ use dom::bindings::js::{RootCollectionPtr, RootedReference}; use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference, trace_refcounted_objects}; use dom::bindings::trace::{JSTraceable, RootedVec, trace_traceables}; use dom::bindings::utils::{DOM_CALLBACKS, WRAP_CALLBACKS}; -use dom::document::{Document, DocumentProgressHandler, DocumentSource, IsHTMLDocument}; +use dom::document::{Document, DocumentProgressHandler, DocumentSource, FocusType, IsHTMLDocument}; use dom::element::Element; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::htmlanchorelement::HTMLAnchorElement; @@ -63,7 +63,7 @@ use libc; use mem::heap_size_of_self_and_children; use msg::compositor_msg::{EventResult, LayerId, ScriptToCompositorMsg}; use msg::constellation_msg::ScriptMsg as ConstellationMsg; -use msg::constellation_msg::{ConstellationChan, FocusType, LoadData}; +use msg::constellation_msg::{ConstellationChan, LoadData}; use msg::constellation_msg::{MouseButton, MouseEventType, MozBrowserEvent, PipelineId}; use msg::constellation_msg::{PipelineNamespace}; use msg::constellation_msg::{SubpageId, WindowSizeData, WorkerId}; |