style: use the XBL styleset quirks mode to match XBL rules.

This fixes bug 1405543.

MozReview-Commit-ID: Dv3mt3Fb8Yp
This commit is contained in:
Emilio Cobos Álvarez 2017-10-09 11:27:01 +02:00
parent 715fc9cea6
commit 100dd18307
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 16 additions and 2 deletions

View file

@ -1270,12 +1270,21 @@ impl Stylist {
// ServoStyleSet::CreateXBLServoStyleSet() loads XBL style sheets
// under eAuthorSheetFeatures level.
if let Some(map) = stylist.cascade_data.author.borrow_for_pseudo(pseudo_element) {
// NOTE(emilio): This is needed because the XBL stylist may
// think it has a different quirks mode than the document.
let mut matching_context = MatchingContext::new(
context.matching_mode,
context.bloom_filter,
context.nth_index_cache.as_mut().map(|s| &mut **s),
stylist.quirks_mode,
);
map.get_all_matching_rules(
element,
&rule_hash_target,
applicable_declarations,
context,
self.quirks_mode,
&mut matching_context,
stylist.quirks_mode,
flags_setter,
CascadeLevel::XBL,
);