style: Make invalidation state also be with the ::slotted rules.

MozReview-Commit-ID: GYmsXYvL9vj
This commit is contained in:
Emilio Cobos Álvarez 2017-12-18 11:58:59 +01:00
parent 5115cbd1c0
commit ce1d8cd232
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 310 additions and 187 deletions

View file

@ -31,7 +31,7 @@ use std::fmt;
use std::fmt::Debug;
use std::hash::Hash;
use std::ops::Deref;
use stylist::Stylist;
use stylist::{StyleRuleCascadeData, Stylist};
use traversal_flags::TraversalFlags;
/// An opaque handle to a node, which, unlike UnsafeNode, cannot be transformed
@ -774,6 +774,41 @@ pub trait TElement
false
}
/// Executes the callback for each applicable style rule data which isn't
/// the main document's data (which stores UA / author rules).
///
/// Returns whether normal document author rules should apply.
fn each_applicable_non_document_style_rule_data<'a, F>(&self, mut f: F) -> bool
where
Self: 'a,
F: FnMut(AtomicRef<'a, StyleRuleCascadeData>, QuirksMode),
{
let cut_off_inheritance = self.each_xbl_stylist(|stylist| {
let quirks_mode = stylist.quirks_mode();
f(
AtomicRef::map(stylist, |stylist| stylist.normal_author_cascade_data()),
quirks_mode,
)
});
let mut current = self.assigned_slot();
while let Some(slot) = current {
slot.each_xbl_stylist(|stylist| {
let quirks_mode = stylist.quirks_mode();
if stylist.slotted_author_cascade_data().is_some() {
f(
AtomicRef::map(stylist, |stylist| stylist.slotted_author_cascade_data().unwrap()),
quirks_mode,
)
}
});
current = slot.assigned_slot();
}
cut_off_inheritance
}
/// Gets the current existing CSS transitions, by |property, end value| pairs in a FnvHashMap.
#[cfg(feature = "gecko")]
fn get_css_transitions_info(&self)