Skip to content
Permalink
Browse files

Move is_connected function from style to layout, where it is used

  • Loading branch information...
ferjm committed Mar 7, 2019
1 parent 5be6779 commit 5a165c6bd85857578fadeb627a78d45afe4949f2
@@ -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> {
@@ -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>
@@ -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 {

0 comments on commit 5a165c6

Please sign in to comment.
You can’t perform that action at this time.