diff options
Diffstat (limited to 'components/layout/wrapper.rs')
-rw-r--r-- | components/layout/wrapper.rs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 706d8b8d04e..6f1d01dcbf2 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -49,7 +49,7 @@ use script::dom::htmlimageelement::{HTMLImageElement, LayoutHTMLImageElementHelp use script::dom::htmlinputelement::{HTMLInputElement, LayoutHTMLInputElementHelpers}; use script::dom::node::{DocumentNodeTypeId, ElementNodeTypeId, Node, NodeTypeId}; use script::dom::node::{LayoutNodeHelpers, RawLayoutNodeHelpers, SharedLayoutData, TextNodeTypeId}; -use script::dom::node::{IsDirty, HasDirtyDescendants}; +use script::dom::node::{HasChanged, IsDirty, HasDirtySiblings, HasDirtyDescendants}; use script::dom::text::Text; use script::layout_interface::LayoutChan; use servo_msg::constellation_msg::{PipelineId, SubpageId}; @@ -267,6 +267,11 @@ impl<'ln> LayoutNode<'ln> { self.parent_node() } } + + pub fn debug_id(self) -> uint { + let opaque: OpaqueNode = OpaqueNodeMethods::from_layout_node(&self); + opaque.to_untrusted_node_address() as uint + } } impl<'ln> TNode<'ln, LayoutElement<'ln>> for LayoutNode<'ln> { @@ -343,6 +348,14 @@ impl<'ln> TNode<'ln, LayoutElement<'ln>> for LayoutNode<'ln> { } } + fn has_changed(self) -> bool { + unsafe { self.node.get_flag(HasChanged) } + } + + unsafe fn set_changed(self, value: bool) { + self.node.set_flag(HasChanged, value) + } + fn is_dirty(self) -> bool { unsafe { self.node.get_flag(IsDirty) } } @@ -351,6 +364,14 @@ impl<'ln> TNode<'ln, LayoutElement<'ln>> for LayoutNode<'ln> { self.node.set_flag(IsDirty, value) } + fn has_dirty_siblings(self) -> bool { + unsafe { self.node.get_flag(HasDirtySiblings) } + } + + unsafe fn set_dirty_siblings(self, value: bool) { + self.node.set_flag(HasDirtySiblings, value); + } + fn has_dirty_descendants(self) -> bool { unsafe { self.node.get_flag(HasDirtyDescendants) } } @@ -668,6 +689,10 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { } } + pub fn debug_id(self) -> uint { + self.node.debug_id() + } + /// Returns the next sibling of this node. Unsafe and private because this can lead to races. unsafe fn next_sibling(&self) -> Option<ThreadSafeLayoutNode<'ln>> { if self.pseudo.is_before() { |