diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index a08da8d40f1..73fe905ebd8 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -14,6 +14,7 @@ use properties::{ComputedValues, PropertyFlags}; use properties::longhands::display::computed_value::T as Display; use selector_parser::{NonTSPseudoClass, PseudoElementCascadeType, SelectorImpl}; use std::fmt; +use str::starts_with_ignore_ascii_case; use string_cache::Atom; use thin_slice::ThinBoxedSlice; use values::serialize_atom_identifier; diff --git a/components/style/gecko/pseudo_element_definition.mako.rs b/components/style/gecko/pseudo_element_definition.mako.rs index be0318eadea..dd27dfd5676 100644 --- a/components/style/gecko/pseudo_element_definition.mako.rs +++ b/components/style/gecko/pseudo_element_definition.mako.rs @@ -242,9 +242,7 @@ impl PseudoElement { return Some(PseudoElement::Placeholder); } _ => { - // FIXME: -moz-tree check should probably be - // ascii-case-insensitive. - if name.starts_with("-moz-tree-") { + if starts_with_ignore_ascii_case(name, "-moz-tree-") { return PseudoElement::tree_pseudo_element(name, Box::new([])) } } diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index fa514835e8c..cc84f58aa13 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -17,6 +17,7 @@ use selectors::parser::{SelectorParseErrorKind, Visit}; use selectors::parser::{self as selector_parser, Selector}; use selectors::visitor::SelectorVisitor; use std::fmt; +use str::starts_with_ignore_ascii_case; use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace}; use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss as ToCss_}; use thin_slice::ThinBoxedSlice; @@ -468,8 +469,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { name: CowRcStr<'i>, parser: &mut Parser<'i, 't>, ) -> Result> { - // FIXME: -moz-tree check should probably be ascii-case-insensitive. - if name.starts_with("-moz-tree-") { + if starts_with_ignore_ascii_case(&name, "-moz-tree-") { // Tree pseudo-elements can have zero or more arguments, separated // by either comma or space. let mut args = Vec::new();