diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-10-18 09:13:00 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-10-19 11:33:13 +0200 |
commit | b0e54968ec89f811504a2bf907d01ddadb9655e7 (patch) | |
tree | 9f9ffeeae1c2c838f53042cf0b02f6e435c26bfd /components/layout_thread/dom_wrapper.rs | |
parent | 4cf2ce66fc4f970a47ab1fb4b9aa1a55282640f7 (diff) | |
download | servo-b0e54968ec89f811504a2bf907d01ddadb9655e7.tar.gz servo-b0e54968ec89f811504a2bf907d01ddadb9655e7.zip |
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.
Diffstat (limited to 'components/layout_thread/dom_wrapper.rs')
-rw-r--r-- | components/layout_thread/dom_wrapper.rs | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index f19e5e13b78..899c47b4747 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -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"); |