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

This commit is contained in:
Emilio Cobos Álvarez 2017-03-30 22:42:21 +02:00
parent 54e2b7b2d5
commit a4bc106e07
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
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;
@ -504,10 +504,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)
}