selectors: Avoid looking at MatchingMode if the selector isn't the topmost.

Also, switch the hover quirk to the same mechanism.

Bug: 1379696
Reviewed-By: bholley
MozReview-Commit-ID: KrmNqNyASf6
This commit is contained in:
Emilio Cobos Álvarez 2017-07-11 03:49:49 +02:00
parent 2475039e40
commit 1f2b79bc30
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 31 additions and 21 deletions

View file

@ -1777,12 +1777,11 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
}
NonTSPseudoClass::MozPlaceholder => false,
NonTSPseudoClass::MozAny(ref sels) => {
let old_value = context.hover_active_quirk_disabled;
context.hover_active_quirk_disabled = true;
context.nesting_level += 1;
let result = sels.iter().any(|s| {
matches_complex_selector(s.iter(), self, context, flags_setter)
});
context.hover_active_quirk_disabled = old_value;
context.nesting_level -= 1;
result
}
NonTSPseudoClass::Lang(ref lang_arg) => {