Clean up bit clearing.

This commit is contained in:
Bobby Holley 2017-08-22 18:47:44 -07:00
parent 3c42792efa
commit 994074fca6
3 changed files with 8 additions and 9 deletions

View file

@ -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 /// In Gecko, this corresponds to the regular dirty descendants bit, the
/// animation-only dirty descendants bit, and the lazy frame construction /// animation-only dirty descendants bit, and the lazy frame construction
/// descendants bit. /// 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. /// Clear all element flags related to dirtiness.
/// ///

View file

@ -1094,7 +1094,7 @@ impl<'le> TElement for GeckoElement<'le> {
self.unset_flags(ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32) 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 | self.unset_flags(ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32 |
ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32 | ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32 |
NODE_DESCENDANTS_NEED_FRAMES as u32) NODE_DESCENDANTS_NEED_FRAMES as u32)
@ -1159,7 +1159,9 @@ impl<'le> TElement for GeckoElement<'le> {
let ptr = self.0.mServoData.get(); let ptr = self.0.mServoData.get();
unsafe { unsafe {
self.unset_flags(ELEMENT_HAS_SNAPSHOT as u32 | 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() { if !ptr.is_null() {
debug!("Dropping ElementData for {:?}", self); debug!("Dropping ElementData for {:?}", self);

View file

@ -878,11 +878,8 @@ where
} }
} }
} }
if p == root { }
// Make sure not to clear NODE_NEEDS_FRAME on the root. // Make sure not to clear NODE_NEEDS_FRAME on the root.
p.clear_descendants_bits(); root.clear_descendant_bits();
} else {
p.clear_dirty_bits();
}
}
} }