mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
This commit is contained in:
parent
30d6d6024b
commit
eb98ae6e04
64 changed files with 541 additions and 512 deletions
|
@ -165,7 +165,7 @@ impl Expression {
|
|||
-> Result<Self, ParseError<'i>> {
|
||||
input.expect_parenthesis_block()?;
|
||||
input.parse_nested_block(|input| {
|
||||
let name = input.expect_ident()?;
|
||||
let name = input.expect_ident_cloned()?;
|
||||
input.expect_colon()?;
|
||||
// TODO: Handle other media features
|
||||
Ok(Expression(match_ignore_ascii_case! { &name,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
use {Atom, Prefix, Namespace, LocalName, CaseSensitivityExt};
|
||||
use attr::{AttrIdentifier, AttrValue};
|
||||
use cssparser::{Parser as CssParser, ToCss, serialize_identifier, CompactCowStr};
|
||||
use cssparser::{Parser as CssParser, ToCss, serialize_identifier, CowRcStr};
|
||||
use dom::{OpaqueNode, TElement, TNode};
|
||||
use element_state::ElementState;
|
||||
use fnv::FnvHashMap;
|
||||
|
@ -20,7 +20,6 @@ use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivit
|
|||
use selectors::parser::{SelectorMethods, SelectorParseError};
|
||||
use selectors::visitor::SelectorVisitor;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use std::fmt::Debug;
|
||||
use std::mem;
|
||||
|
@ -334,7 +333,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
type Impl = SelectorImpl;
|
||||
type Error = StyleParseError<'i>;
|
||||
|
||||
fn parse_non_ts_pseudo_class(&self, name: CompactCowStr<'i>)
|
||||
fn parse_non_ts_pseudo_class(&self, name: CowRcStr<'i>)
|
||||
-> Result<NonTSPseudoClass, ParseError<'i>> {
|
||||
use self::NonTSPseudoClass::*;
|
||||
let pseudo_class = match_ignore_ascii_case! { &name,
|
||||
|
@ -367,19 +366,19 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
}
|
||||
|
||||
fn parse_non_ts_functional_pseudo_class<'t>(&self,
|
||||
name: CompactCowStr<'i>,
|
||||
name: CowRcStr<'i>,
|
||||
parser: &mut CssParser<'i, 't>)
|
||||
-> Result<NonTSPseudoClass, ParseError<'i>> {
|
||||
use self::NonTSPseudoClass::*;
|
||||
let pseudo_class = match_ignore_ascii_case!{ &name,
|
||||
"lang" => {
|
||||
Lang(parser.expect_ident_or_string()?.into_owned().into_boxed_str())
|
||||
Lang(parser.expect_ident_or_string()?.as_ref().into())
|
||||
}
|
||||
"-servo-case-sensitive-type-attr" => {
|
||||
if !self.in_user_agent_stylesheet() {
|
||||
return Err(SelectorParseError::UnexpectedIdent(name.clone()).into());
|
||||
}
|
||||
ServoCaseSensitiveTypeAttr(Atom::from(Cow::from(parser.expect_ident()?)))
|
||||
ServoCaseSensitiveTypeAttr(Atom::from(parser.expect_ident()?.as_ref()))
|
||||
}
|
||||
_ => return Err(SelectorParseError::UnexpectedIdent(name.clone()).into())
|
||||
};
|
||||
|
@ -387,7 +386,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
Ok(pseudo_class)
|
||||
}
|
||||
|
||||
fn parse_pseudo_element(&self, name: CompactCowStr<'i>) -> Result<PseudoElement, ParseError<'i>> {
|
||||
fn parse_pseudo_element(&self, name: CowRcStr<'i>) -> Result<PseudoElement, ParseError<'i>> {
|
||||
use self::PseudoElement::*;
|
||||
let pseudo_element = match_ignore_ascii_case! { &name,
|
||||
"before" => Before,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue