diff --git a/components/style/dom.rs b/components/style/dom.rs index 74f0b8b5bd4..6b67336aa2b 100644 --- a/components/style/dom.rs +++ b/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/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 7261d02afc7..305543813d7 100644 --- a/components/style/gecko/wrapper.rs +++ b/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/components/style/traversal.rs b/components/style/traversal.rs index a3fe06f3fef..23f8cc50fbb 100644 --- a/components/style/traversal.rs +++ b/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(); }