diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-10-14 16:51:30 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-10-14 16:51:30 -0600 |
commit | 56989b8dec4aa95a3b484d45f15b23f9b3daaf13 (patch) | |
tree | 91c6c430b9a9513be320bc69d79b63f1523f2af5 /components/layout/wrapper.rs | |
parent | e2d7777c41135b71293c195d2a9d7a1bc2afd0ca (diff) | |
parent | f552e2f7501337fae76ad66401a1e011d00211df (diff) | |
download | servo-56989b8dec4aa95a3b484d45f15b23f9b3daaf13.tar.gz servo-56989b8dec4aa95a3b484d45f15b23f9b3daaf13.zip |
auto merge of #3640 : cgaebel/servo/incremental-flow-construction, r=pcwalton
This also hides the not-yet-working parts of incremental reflow behind a runtime
flag. As I get the failing reftests passing, I'll send pull requests for them one
by one.
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() { |