mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
style: Make MatchingContext generic over SelectorImpl.
This will help Xidorn implement tree pseudos, and in general makes sense, allowing to put specific matching data in a selectors implementation.
This commit is contained in:
parent
4cf2ce66fc
commit
b0e54968ec
9 changed files with 121 additions and 85 deletions
|
@ -686,21 +686,23 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
|||
self.element.namespace()
|
||||
}
|
||||
|
||||
fn match_pseudo_element(&self,
|
||||
_pseudo: &PseudoElement,
|
||||
_context: &mut MatchingContext)
|
||||
-> bool
|
||||
{
|
||||
fn match_pseudo_element(
|
||||
&self,
|
||||
_pseudo: &PseudoElement,
|
||||
_context: &mut MatchingContext<Self::Impl>,
|
||||
) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn match_non_ts_pseudo_class<F>(&self,
|
||||
pseudo_class: &NonTSPseudoClass,
|
||||
_: &mut MatchingContext,
|
||||
_: &RelevantLinkStatus,
|
||||
_: &mut F)
|
||||
-> bool
|
||||
where F: FnMut(&Self, ElementSelectorFlags),
|
||||
fn match_non_ts_pseudo_class<F>(
|
||||
&self,
|
||||
pseudo_class: &NonTSPseudoClass,
|
||||
_: &mut MatchingContext<Self::Impl>,
|
||||
_: &RelevantLinkStatus,
|
||||
_: &mut F,
|
||||
) -> bool
|
||||
where
|
||||
F: FnMut(&Self, ElementSelectorFlags),
|
||||
{
|
||||
match *pseudo_class {
|
||||
// https://github.com/servo/servo/issues/8718
|
||||
|
@ -1176,11 +1178,11 @@ impl<'le> ::selectors::Element for ServoThreadSafeLayoutElement<'le> {
|
|||
self.element.get_namespace()
|
||||
}
|
||||
|
||||
fn match_pseudo_element(&self,
|
||||
_pseudo: &PseudoElement,
|
||||
_context: &mut MatchingContext)
|
||||
-> bool
|
||||
{
|
||||
fn match_pseudo_element(
|
||||
&self,
|
||||
_pseudo: &PseudoElement,
|
||||
_context: &mut MatchingContext<Self::Impl>
|
||||
) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
|
@ -1203,13 +1205,15 @@ impl<'le> ::selectors::Element for ServoThreadSafeLayoutElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
fn match_non_ts_pseudo_class<F>(&self,
|
||||
_: &NonTSPseudoClass,
|
||||
_: &mut MatchingContext,
|
||||
_: &RelevantLinkStatus,
|
||||
_: &mut F)
|
||||
-> bool
|
||||
where F: FnMut(&Self, ElementSelectorFlags),
|
||||
fn match_non_ts_pseudo_class<F>(
|
||||
&self,
|
||||
_: &NonTSPseudoClass,
|
||||
_: &mut MatchingContext<Self::Impl>,
|
||||
_: &RelevantLinkStatus,
|
||||
_: &mut F,
|
||||
) -> bool
|
||||
where
|
||||
F: FnMut(&Self, ElementSelectorFlags),
|
||||
{
|
||||
// NB: This could maybe be implemented
|
||||
warn!("ServoThreadSafeLayoutElement::match_non_ts_pseudo_class called");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue