From 5a165c6bd85857578fadeb627a78d45afe4949f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Thu, 7 Mar 2019 13:59:23 +0100 Subject: [PATCH] Move is_connected function from style to layout, where it is used --- components/layout_thread/dom_wrapper.rs | 8 ++++---- components/script_layout_interface/wrapper_traits.rs | 3 +++ 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 { TreeIterator::new(self) } + + /// Returns whether the node is connected. + fn is_connected(&self) -> bool; } pub struct ReverseChildrenIterator 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 { DomDescendants {