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

@ -4326,25 +4326,14 @@ pub extern "C" fn Servo_StyleSet_MightHaveAttributeDependency(
) -> bool {
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
let element = GeckoElement(element);
let mut has_dep = false;
unsafe {
Atom::with(local_name, |atom| {
has_dep = data.stylist.might_have_attribute_dependency(atom);
if !has_dep {
// TODO(emilio): Consider optimizing this storing attribute
// dependencies from UA sheets separately, so we could optimize
// the above lookup if cut_off_inheritance is true.
element.each_xbl_stylist(|stylist| {
has_dep =
has_dep || stylist.might_have_attribute_dependency(atom);
});
}
data.stylist.any_applicable_rule_data(element, |data, _| {
data.might_have_attribute_dependency(atom)
})
})
}
has_dep
}
#[no_mangle]
@ -4358,17 +4347,9 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency(
let state = ElementState::from_bits_truncate(state);
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
let mut has_dep = data.stylist.has_state_dependency(state);
if !has_dep {
// TODO(emilio): Consider optimizing this storing attribute
// dependencies from UA sheets separately, so we could optimize
// the above lookup if cut_off_inheritance is true.
element.each_xbl_stylist(|stylist| {
has_dep = has_dep || stylist.has_state_dependency(state);
});
}
has_dep
data.stylist.any_applicable_rule_data(element, |data, _| {
data.has_state_dependency(state)
})
}
#[no_mangle]