diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-03-07 13:59:23 +0100 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-04-26 11:42:38 +0200 |
commit | 5a165c6bd85857578fadeb627a78d45afe4949f2 (patch) | |
tree | b456c9328ea3fecf05ae015e4ecd24c26e18e4fd | |
parent | 5be6779f9a65218a41d970eab6f01dd5d6b60775 (diff) | |
download | servo-5a165c6bd85857578fadeb627a78d45afe4949f2.tar.gz servo-5a165c6bd85857578fadeb627a78d45afe4949f2.zip |
Move is_connected function from style to layout, where it is used
-rw-r--r-- | components/layout_thread/dom_wrapper.rs | 8 | ||||
-rw-r--r-- | components/script_layout_interface/wrapper_traits.rs | 3 | ||||
-rw-r--r-- | components/style/dom.rs | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index 5a231161d7b..58f3ed7327e 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -306,10 +306,6 @@ impl<'ln> TNode for ServoLayoutNode<'ln> { fn is_in_document(&self) -> bool { unsafe { self.node.get_flag(NodeFlags::IS_IN_DOC) } } - - fn is_connected(&self) -> bool { - unsafe { self.node.get_flag(NodeFlags::IS_CONNECTED) } - } } impl<'ln> LayoutNode for ServoLayoutNode<'ln> { @@ -340,6 +336,10 @@ impl<'ln> LayoutNode for ServoLayoutNode<'ln> { unsafe fn take_style_and_layout_data(&self) -> OpaqueStyleAndLayoutData { self.get_jsmanaged().take_style_and_layout_data() } + + fn is_connected(&self) -> bool { + unsafe { self.node.get_flag(NodeFlags::IS_CONNECTED) } + } } impl<'ln> GetLayoutData for ServoLayoutNode<'ln> { diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index 0a7e080bebb..0e1df2ac4c8 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -104,6 +104,9 @@ pub trait LayoutNode: Debug + GetLayoutData + TNode { fn traverse_preorder(self) -> TreeIterator<Self> { TreeIterator::new(self) } + + /// Returns whether the node is connected. + fn is_connected(&self) -> bool; } pub struct ReverseChildrenIterator<ConcreteNode> diff --git a/components/style/dom.rs b/components/style/dom.rs index 541ef4dbcdc..967b978bad4 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -188,9 +188,6 @@ pub trait TNode: Sized + Copy + Clone + Debug + NodeInfo + PartialEq { /// Returns whether the node is attached to a document. fn is_in_document(&self) -> bool; - /// Returns whether the node is connected. - fn is_connected(&self) -> bool; - /// Iterate over the DOM children of a node, in preorder. fn dom_descendants(&self) -> DomDescendants<Self> { DomDescendants { |