Auto merge of #18246 - bholley:restyle_root_followups, r=emilio

stylo: followup fixes for restyle roots

https://bugzilla.mozilla.org/show_bug.cgi?id=1392863

<!-- 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/18246)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-26 12:22:33 -05:00 committed by GitHub
commit 1fd0edf158
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
/// 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.
///

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)
}
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);

View file

@ -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();
}