Skip to content

Commit

Permalink
style: Make tree pseudo-element prefix not case-sensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper authored and emilio committed Sep 3, 2018
1 parent dceb586 commit c587fa3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions components/style/gecko/pseudo_element.rs
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions components/style/gecko/pseudo_element_definition.mako.rs
Expand Up @@ -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([]))
}
}
Expand Down
4 changes: 2 additions & 2 deletions components/style/gecko/selector_parser.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -468,8 +469,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
name: CowRcStr<'i>,
parser: &mut Parser<'i, 't>,
) -> Result<PseudoElement, ParseError<'i>> {
// 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();
Expand Down

0 comments on commit c587fa3

Please sign in to comment.