From 561018da7d3302c3205f059440ecd987d5be1a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 6 May 2019 10:06:26 +0200 Subject: [PATCH] style: Fix servo build. --- components/style/servo/selector_parser.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index 9d94c467b58..1ef49c87f9f 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -66,10 +66,6 @@ pub const PSEUDO_COUNT: usize = PseudoElement::ServoInlineAbsolute as usize + 1; impl ::selectors::parser::PseudoElement for PseudoElement { type Impl = SelectorImpl; - - fn supports_pseudo_class(&self, _: &NonTSPseudoClass) -> bool { - false - } } impl ToCss for PseudoElement { @@ -293,6 +289,14 @@ impl ::selectors::parser::NonTSPseudoClass for NonTSPseudoClass { fn is_active_or_hover(&self) -> bool { matches!(*self, NonTSPseudoClass::Active | NonTSPseudoClass::Hover) } + + #[inline] + fn is_user_action_state(&self) -> bool { + matches!( + *self, + NonTSPseudoClass::Active | NonTSPseudoClass::Hover | NonTSPseudoClass::Focus + ) + } } impl ToCss for NonTSPseudoClass { @@ -393,6 +397,7 @@ impl ::selectors::SelectorImpl for SelectorImpl { type AttrValue = String; type Identifier = Atom; type ClassName = Atom; + type PartName = Atom; type LocalName = LocalName; type NamespacePrefix = Prefix; type NamespaceUrl = Namespace; @@ -679,6 +684,10 @@ impl ElementSnapshot for ServoElementSnapshot { .map(|v| v.as_atom()) } + fn is_part(&self, _name: &Atom) -> bool { + false + } + fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool { self.get_attr(&ns!(), &local_name!("class")) .map_or(false, |v| {