style: Hide LocalMatchingContext.

This type is a lot of complexity related to a very specific thing such as the
hover and active quirk.

Instead of that, move `nesting_level` to `MatchingContext`, and simplify all
this computing whether the quirk applies upfront, for each complex selector we
test.

This is less error-prone, and also allows simplifying more stuff in a bit.
This commit is contained in:
Emilio Cobos Álvarez 2017-10-14 13:13:26 +02:00
parent 48c85151dc
commit 11485edc9e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 175 additions and 183 deletions

View file

@ -89,7 +89,7 @@ use script_layout_interface::message::ReflowGoal;
use script_thread::ScriptThread;
use selectors::Element as SelectorsElement;
use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity};
use selectors::matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext, RelevantLinkStatus};
use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, RelevantLinkStatus};
use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS};
use selectors::sink::Push;
use servo_arc::Arc;
@ -2583,7 +2583,7 @@ impl<'a> SelectorsElement for DomRoot<Element> {
fn match_non_ts_pseudo_class<F>(&self,
pseudo_class: &NonTSPseudoClass,
_: &mut LocalMatchingContext<Self::Impl>,
_: &mut MatchingContext,
_: &RelevantLinkStatus,
_: &mut F)
-> bool