Skip to content

Commit

Permalink
style: Fix servo build.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed May 7, 2019
1 parent 57874ae commit 561018d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/style/servo/selector_parser.rs
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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| {
Expand Down

0 comments on commit 561018d

Please sign in to comment.