Auto merge of #16196 - emilio:unify-note-descendants, r=bholley

style: Make the servo and gecko implementations of Element::note_descendants equivalent.

<!-- 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/16196)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-03-31 04:40:13 -05:00 committed by GitHub
commit 95e0532dd6
3 changed files with 71 additions and 28 deletions

View file

@ -17,7 +17,7 @@
use atomic_refcell::AtomicRefCell;
use context::UpdateAnimationsTasks;
use data::ElementData;
use dom::{AnimationRules, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode};
use dom::{self, AnimationRules, DescendantsBit, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode};
use dom::{OpaqueNode, PresentationalHintsSynthetizer};
use element_state::ElementState;
use error_reporting::StdoutErrorReporter;
@ -505,10 +505,18 @@ impl<'le> TElement for GeckoElement<'le> {
}
unsafe fn set_dirty_descendants(&self) {
debug_assert!(self.get_data().is_some());
debug!("Setting dirty descendants: {:?}", self);
self.set_flags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32)
}
unsafe fn note_descendants<B: DescendantsBit<Self>>(&self) {
debug_assert!(self.get_data().is_some());
if dom::raw_note_descendants::<Self, B>(*self) {
bindings::Gecko_SetOwnerDocumentNeedsStyleFlush(self.0);
}
}
unsafe fn unset_dirty_descendants(&self) {
self.unset_flags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32)
}