style: Use more CascadeData and less Stylist for XBL stuff.

Just some more uses of Stylist in XBL that can be converted right away.

I'm trying to make XBL not use a Stylist, slowly...
This commit is contained in:
Emilio Cobos Álvarez 2018-02-12 11:19:46 +01:00
parent 4913d9c900
commit 1bb6ce2c88
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 23 additions and 35 deletions

View file

@ -1268,8 +1268,8 @@ impl Stylist {
}
for slot in slots.iter().rev() {
slot.each_xbl_stylist(|stylist| {
if let Some(map) = stylist.cascade_data.author.slotted_rules(pseudo_element) {
slot.each_xbl_cascade_data(|cascade_data, _quirks_mode| {
if let Some(map) = cascade_data.slotted_rules(pseudo_element) {
map.get_all_matching_rules(
element,
rule_hash_target,
@ -1287,8 +1287,8 @@ impl Stylist {
// even for getDefaultComputedStyle!
//
// Also, this doesn't account for the author_styles_enabled stuff.
let cut_off_inheritance = element.each_xbl_stylist(|stylist| {
if let Some(map) = stylist.cascade_data.author.normal_rules(pseudo_element) {
let cut_off_inheritance = element.each_xbl_cascade_data(|cascade_data, quirks_mode| {
if let Some(map) = cascade_data.normal_rules(pseudo_element) {
// NOTE(emilio): This is needed because the XBL stylist may
// think it has a different quirks mode than the document.
//
@ -1299,7 +1299,7 @@ impl Stylist {
context.matching_mode(),
context.bloom_filter,
context.nth_index_cache.as_mut().map(|s| &mut **s),
stylist.quirks_mode,
quirks_mode,
);
matching_context.pseudo_element_matching_fn = context.pseudo_element_matching_fn;