diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-05-10 15:08:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-10 15:08:59 -0500 |
commit | c8171ed5d7d4b715ab30795311724420c95dfa10 (patch) | |
tree | f04508930a59c7ab4b3d12eb68131d1a925b2e33 /components/script/layout_wrapper.rs | |
parent | d5efed6c6a3e05f09300a3ed36d0e1254fcb407c (diff) | |
parent | e6fc0aae14757004447fd8aef8f7e32d6ec8ce0b (diff) | |
download | servo-c8171ed5d7d4b715ab30795311724420c95dfa10.tar.gz servo-c8171ed5d7d4b715ab30795311724420c95dfa10.zip |
Auto merge of #16778 - emilio:snapshots, r=bholley
Take all the snapshots into account in the style system
See [bug 1355343](https://bugzilla.mozilla.org/show_bug.cgi?id=1355343).
The servo part of this patch presumably needs some polishing, let's see.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16778)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r-- | components/script/layout_wrapper.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 46e5921e3ac..7ae6a7e621e 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -39,6 +39,7 @@ use dom::characterdata::LayoutCharacterDataHelpers; use dom::document::{Document, LayoutDocumentHelpers, PendingRestyle}; use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers}; use dom::node::{CAN_BE_FRAGMENTED, DIRTY_ON_VIEWPORT_SIZE_CHANGE, HAS_DIRTY_DESCENDANTS, IS_IN_DOC}; +use dom::node::{HANDLED_SNAPSHOT, HAS_SNAPSHOT}; use dom::node::{LayoutNodeHelpers, Node}; use dom::text::Text; use gfx_traits::ByteIndex; @@ -413,6 +414,18 @@ impl<'le> TElement for ServoLayoutElement<'le> { unsafe { self.as_node().node.get_flag(HAS_DIRTY_DESCENDANTS) } } + fn has_snapshot(&self) -> bool { + unsafe { self.as_node().node.get_flag(HAS_SNAPSHOT) } + } + + fn handled_snapshot(&self) -> bool { + unsafe { self.as_node().node.get_flag(HANDLED_SNAPSHOT) } + } + + unsafe fn set_handled_snapshot(&self) { + self.as_node().node.set_flag(HANDLED_SNAPSHOT, true); + } + unsafe fn note_descendants<B: DescendantsBit<Self>>(&self) { debug_assert!(self.get_data().is_some()); style::dom::raw_note_descendants::<Self, B>(*self); @@ -509,6 +522,14 @@ impl<'le> ServoLayoutElement<'le> { } } + pub unsafe fn unset_snapshot_flags(&self) { + self.as_node().node.set_flag(HAS_SNAPSHOT | HANDLED_SNAPSHOT, false); + } + + pub unsafe fn set_has_snapshot(&self) { + self.as_node().node.set_flag(HAS_SNAPSHOT, true); + } + // FIXME(bholley): This should be merged with TElement::note_descendants, // but that requires re-testing and possibly fixing the broken callers given // the FIXME below, which I don't have time to do right now. |