From 1ad4801a389dce9245a18a08844c9931d0c8a24f Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Sat, 26 Aug 2017 12:22:33 -0500 Subject: [PATCH] servo: Merge #18246 - stylo: followup fixes for restyle roots (from bholley:restyle_root_followups); r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1392863 Source-Repo: https://github.com/servo/servo Source-Revision: 1fd0edf158bb479b420fb6ddc76470d82c88cb61 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : e8f1719c27589efb90b7f844eadaa4ed68b62137 --- servo/components/style/dom.rs | 2 +- servo/components/style/gecko/wrapper.rs | 6 ++++-- servo/components/style/traversal.rs | 9 +++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/servo/components/style/dom.rs b/servo/components/style/dom.rs index 74f0b8b5bd49..6b67336aa2be 100644 --- a/servo/components/style/dom.rs +++ b/servo/components/style/dom.rs @@ -506,7 +506,7 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + /// In Gecko, this corresponds to the regular dirty descendants bit, the /// animation-only dirty descendants bit, and the lazy frame construction /// descendants bit. - unsafe fn clear_descendants_bits(&self) { self.unset_dirty_descendants(); } + unsafe fn clear_descendant_bits(&self) { self.unset_dirty_descendants(); } /// Clear all element flags related to dirtiness. /// diff --git a/servo/components/style/gecko/wrapper.rs b/servo/components/style/gecko/wrapper.rs index 7261d02afc72..305543813d7c 100644 --- a/servo/components/style/gecko/wrapper.rs +++ b/servo/components/style/gecko/wrapper.rs @@ -1094,7 +1094,7 @@ impl<'le> TElement for GeckoElement<'le> { self.unset_flags(ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32) } - unsafe fn clear_descendants_bits(&self) { + unsafe fn clear_descendant_bits(&self) { self.unset_flags(ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32 | ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32 | NODE_DESCENDANTS_NEED_FRAMES as u32) @@ -1159,7 +1159,9 @@ impl<'le> TElement for GeckoElement<'le> { let ptr = self.0.mServoData.get(); unsafe { self.unset_flags(ELEMENT_HAS_SNAPSHOT as u32 | - ELEMENT_HANDLED_SNAPSHOT as u32); + ELEMENT_HANDLED_SNAPSHOT as u32 | + structs::Element_kAllServoDescendantBits | + NODE_NEEDS_FRAME as u32); } if !ptr.is_null() { debug!("Dropping ElementData for {:?}", self); diff --git a/servo/components/style/traversal.rs b/servo/components/style/traversal.rs index a3fe06f3feff..23f8cc50fbbd 100644 --- a/servo/components/style/traversal.rs +++ b/servo/components/style/traversal.rs @@ -878,11 +878,8 @@ where } } } - if p == root { - // Make sure not to clear NODE_NEEDS_FRAME on the root. - p.clear_descendants_bits(); - } else { - p.clear_dirty_bits(); - } } + + // Make sure not to clear NODE_NEEDS_FRAME on the root. + root.clear_descendant_bits(); }