Skip to content
Permalink
Browse files

style: Make tree pseudo-element prefix not case-sensitive.

  • Loading branch information
upsuper authored and emilio committed Sep 3, 2018
1 parent dceb586 commit c587fa35867a0206a77ea67b7b8738045c7d42a9
@@ -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;
@@ -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([]))
}
}
@@ -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<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();

0 comments on commit c587fa3

Please sign in to comment.
You can’t perform that action at this time.