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:
Emilio Cobos Álvarez 2017-10-18 09:13:00 +02:00
parent 4cf2ce66fc
commit b0e54968ec
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
9 changed files with 121 additions and 85 deletions

View file

@ -2528,11 +2528,11 @@ impl<'a> SelectorsElement for DomRoot<Element> {
self.upcast::<Node>().GetParentElement()
}
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
}
@ -2594,13 +2594,15 @@ impl<'a> SelectorsElement for DomRoot<Element> {
self.namespace()
}
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