Bug 1549301 - Fix Servo build.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 06 May 2019 10:06:26 +0200
changeset 472668 b23a5dd08d9a2f06baa2ff402312a9f74cbf62a3
parent 472667 a72ba580785282913ff100fc6184e4c584a79950
child 472669 f92e2f3f7fa9b920780230a3db4695ecb15d55eb
push id35976
push useropoprus@mozilla.com
push dateMon, 06 May 2019 21:44:12 +0000
treeherdermozilla-central@e9f5f01d8b8e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1549301
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549301 - Fix Servo build.
servo/components/style/servo/selector_parser.rs
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -61,20 +61,16 @@ pub enum PseudoElement {
     ServoInlineAbsolute,
 }
 
 /// The count of all pseudo-elements.
 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 {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
     where
         W: fmt::Write,
     {
         use self::PseudoElement::*;
@@ -288,16 +284,24 @@ pub enum NonTSPseudoClass {
 
 impl ::selectors::parser::NonTSPseudoClass for NonTSPseudoClass {
     type Impl = SelectorImpl;
 
     #[inline]
     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 {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
     where
         W: fmt::Write,
     {
         use self::NonTSPseudoClass::*;
@@ -388,16 +392,17 @@ pub struct SelectorImpl;
 impl ::selectors::SelectorImpl for SelectorImpl {
     type PseudoElement = PseudoElement;
     type NonTSPseudoClass = NonTSPseudoClass;
 
     type ExtraMatchingData = InvalidationMatchingData;
     type AttrValue = String;
     type Identifier = Atom;
     type ClassName = Atom;
+    type PartName = Atom;
     type LocalName = LocalName;
     type NamespacePrefix = Prefix;
     type NamespaceUrl = Namespace;
     type BorrowedLocalName = LocalName;
     type BorrowedNamespaceUrl = Namespace;
 }
 
 impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
@@ -674,16 +679,20 @@ impl ElementSnapshot for ServoElementSna
         self.attrs.is_some()
     }
 
     fn id_attr(&self) -> Option<&Atom> {
         self.get_attr(&ns!(), &local_name!("id"))
             .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| {
                 v.as_tokens()
                     .iter()
                     .any(|atom| case_sensitivity.eq_atom(atom, name))
             })
     }