diff options
Diffstat (limited to 'components/style_traits')
-rw-r--r-- | components/style_traits/Cargo.toml | 2 | ||||
-rw-r--r-- | components/style_traits/lib.rs | 16 | ||||
-rw-r--r-- | components/style_traits/values.rs | 2 | ||||
-rw-r--r-- | components/style_traits/viewport.rs | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml index 3473d710353..a4dcdc20fc5 100644 --- a/components/style_traits/Cargo.toml +++ b/components/style_traits/Cargo.toml @@ -16,7 +16,7 @@ gecko = [] [dependencies] app_units = "0.5" bitflags = "0.7" -cssparser = "0.17.0" +cssparser = "0.18" euclid = "0.15" heapsize = {version = "0.4", optional = true} heapsize_derive = {version = "0.1", optional = true} diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs index 5047388ac37..1747783e2b0 100644 --- a/components/style_traits/lib.rs +++ b/components/style_traits/lib.rs @@ -22,7 +22,7 @@ extern crate euclid; extern crate selectors; #[cfg(feature = "servo")] #[macro_use] extern crate serde; -use cssparser::{CompactCowStr, Token}; +use cssparser::{CowRcStr, Token}; use selectors::parser::SelectorParseError; /// Opaque type stored in type-unsafe work queues for parallel layout. @@ -87,9 +87,9 @@ pub type ParseError<'i> = cssparser::ParseError<'i, SelectorParseError<'i, Style /// Errors that can be encountered while parsing CSS values. pub enum StyleParseError<'i> { /// A bad URL token in a DVB. - BadUrlInDeclarationValueBlock(CompactCowStr<'i>), + BadUrlInDeclarationValueBlock(CowRcStr<'i>), /// A bad string token in a DVB. - BadStringInDeclarationValueBlock(CompactCowStr<'i>), + BadStringInDeclarationValueBlock(CowRcStr<'i>), /// Unexpected closing parenthesis in a DVB. UnbalancedCloseParenthesisInDeclarationValueBlock, /// Unexpected closing bracket in a DVB. @@ -101,11 +101,11 @@ pub enum StyleParseError<'i> { /// A property declaration value had input remaining after successfully parsing. PropertyDeclarationValueNotExhausted, /// An unexpected dimension token was encountered. - UnexpectedDimension(CompactCowStr<'i>), + UnexpectedDimension(CowRcStr<'i>), /// A media query using a ranged expression with no value was encountered. RangedExpressionWithNoValue, /// A function was encountered that was not expected. - UnexpectedFunction(CompactCowStr<'i>), + UnexpectedFunction(CowRcStr<'i>), /// @namespace must be before any rule but @charset and @import UnexpectedNamespaceRule, /// @import must be before any rule but @charset @@ -113,7 +113,7 @@ pub enum StyleParseError<'i> { /// Unexpected @charset rule encountered. UnexpectedCharsetRule, /// Unsupported @ rule - UnsupportedAtRule(CompactCowStr<'i>), + UnsupportedAtRule(CowRcStr<'i>), /// A placeholder for many sources of errors that require more specific variants. UnspecifiedError, /// An unexpected token was found within a namespace rule. @@ -124,13 +124,13 @@ pub enum StyleParseError<'i> { #[derive(Eq, PartialEq, Clone, Debug)] pub enum PropertyDeclarationParseError<'i> { /// The property declaration was for an unknown property. - UnknownProperty(CompactCowStr<'i>), + UnknownProperty(CowRcStr<'i>), /// An unknown vendor-specific identifier was encountered. UnknownVendorProperty, /// The property declaration was for a disabled experimental property. ExperimentalProperty, /// The property declaration contained an invalid value. - InvalidValue(CompactCowStr<'i>), + InvalidValue(CowRcStr<'i>), /// The declaration contained an animation property, and we were parsing /// this as a keyframe block (so that property should be ignored). /// diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 6024eae4054..0d0d74b1fa9 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -409,7 +409,7 @@ macro_rules! __define_css_keyword_enum__actual { Self::from_ident(&ident) .map_err(|()| ::cssparser::ParseError::Basic( ::cssparser::BasicParseError::UnexpectedToken( - ::cssparser::Token::Ident(ident)))) + ::cssparser::Token::Ident(ident.clone())))) } /// Parse this property from an already-tokenized identifier. diff --git a/components/style_traits/viewport.rs b/components/style_traits/viewport.rs index 002aa16ab51..01d9b541ac3 100644 --- a/components/style_traits/viewport.rs +++ b/components/style_traits/viewport.rs @@ -154,7 +154,7 @@ impl Zoom { use cssparser::Token; use values::specified::AllowedLengthType::NonNegative; - match input.next()? { + match *input.next()? { // TODO: This parse() method should take ParserContext as an // argument, and pass ParsingMode owned by the ParserContext to // is_ok() instead of using PARSING_MODE_DEFAULT directly. @@ -168,7 +168,7 @@ impl Zoom { Token::Ident(ref value) if value.eq_ignore_ascii_case("auto") => { Ok(Zoom::Auto) } - t => Err(CssParseError::Basic(BasicParseError::UnexpectedToken(t))) + ref t => Err(CssParseError::Basic(BasicParseError::UnexpectedToken(t.clone()))) } } |