Do all descendant bit propagation from Gecko over FFI.

Deduplicating code is nice, and it will help us when we make the bit
propagation more complicated in upcoming patches.

MozReview-Commit-ID: KIQnNJVayrM
This commit is contained in:
Bobby Holley 2017-07-18 16:17:02 -07:00
parent 8fb7836f40
commit 24a52b7990
3 changed files with 8 additions and 98 deletions

View file

@ -63,14 +63,13 @@ use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
use std::mem::transmute;
use std::sync::atomic::Ordering;
use style;
use style::CaseSensitivityExt;
use style::applicable_declarations::ApplicableDeclarationBlock;
use style::attr::AttrValue;
use style::computed_values::display;
use style::context::{QuirksMode, SharedStyleContext};
use style::data::ElementData;
use style::dom::{DescendantsBit, DirtyDescendants, LayoutIterator, NodeInfo, OpaqueNode};
use style::dom::{LayoutIterator, NodeInfo, OpaqueNode};
use style::dom::{PresentationalHintsSynthesizer, TElement, TNode, UnsafeNode};
use style::element_state::*;
use style::font_metrics::ServoMetricsProvider;
@ -469,11 +468,6 @@ impl<'le> TElement for ServoLayoutElement<'le> {
self.as_node().node.set_flag(HANDLED_SNAPSHOT, true);
}
unsafe fn note_descendants<B: DescendantsBit<Self>>(&self) {
debug_assert!(self.get_data().is_some());
style::dom::raw_note_descendants::<Self, B>(*self);
}
unsafe fn set_dirty_descendants(&self) {
debug_assert!(self.as_node().node.get_flag(IS_IN_DOC));
self.as_node().node.set_flag(HAS_DIRTY_DESCENDANTS, true)
@ -625,12 +619,6 @@ impl<'le> ServoLayoutElement<'le> {
self.as_node().node.set_flag(HAS_SNAPSHOT, true);
}
// FIXME(bholley): This should be merged with TElement::note_descendants,
// but that requires re-testing and possibly fixing the broken callers given
// the FIXME below, which I don't have time to do right now.
//
// FIXME(emilio): We'd also need to relax the invariant in note_descendants
// re. the data already available I think.
pub unsafe fn note_dirty_descendant(&self) {
use ::selectors::Element;
@ -644,8 +632,6 @@ impl<'le> ServoLayoutElement<'le> {
el.set_dirty_descendants();
current = el.parent_element();
}
debug_assert!(self.descendants_bit_is_propagated::<DirtyDescendants>());
}
}