mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
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:
parent
48c85151dc
commit
11485edc9e
7 changed files with 175 additions and 183 deletions
|
@ -6,7 +6,7 @@
|
|||
//! between layout and style.
|
||||
|
||||
use attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity};
|
||||
use matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext, RelevantLinkStatus};
|
||||
use matching::{ElementSelectorFlags, MatchingContext, RelevantLinkStatus};
|
||||
use parser::SelectorImpl;
|
||||
use servo_arc::NonZeroPtrMut;
|
||||
use std::fmt::Debug;
|
||||
|
@ -64,12 +64,15 @@ pub trait Element: Sized + Clone + Debug {
|
|||
operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>)
|
||||
-> bool;
|
||||
|
||||
fn match_non_ts_pseudo_class<F>(&self,
|
||||
pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
|
||||
context: &mut LocalMatchingContext<Self::Impl>,
|
||||
relevant_link: &RelevantLinkStatus,
|
||||
flags_setter: &mut F) -> bool
|
||||
where F: FnMut(&Self, ElementSelectorFlags);
|
||||
fn match_non_ts_pseudo_class<F>(
|
||||
&self,
|
||||
pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
|
||||
context: &mut MatchingContext,
|
||||
relevant_link: &RelevantLinkStatus,
|
||||
flags_setter: &mut F,
|
||||
) -> bool
|
||||
where
|
||||
F: FnMut(&Self, ElementSelectorFlags);
|
||||
|
||||
fn match_pseudo_element(&self,
|
||||
pe: &<Self::Impl as SelectorImpl>::PseudoElement,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue