Auto merge of #17658 - emilio:nesting-level, r=bholley

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17658)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-10 19:16:35 -07:00 committed by GitHub
commit 8fa2a262dc
2 changed files with 31 additions and 21 deletions

View file

@ -1778,12 +1778,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) => {