mirror of
https://github.com/servo/servo.git
synced 2025-06-29 03:23:41 +01:00
style: Make tree pseudo-element prefix not case-sensitive.
Differential Revision: https://phabricator.services.mozilla.com/D4185
This commit is contained in:
parent
dceb58664e
commit
c587fa3586
3 changed files with 4 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue