diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 9da84c3cc16..7fd74f83c1b 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -8,7 +8,6 @@ use Atom; use cssparser::{Delimiter, Parser, ParserInput, SourcePosition, Token, TokenSerializationType}; -use parser::ParserContext; use precomputed_hash::PrecomputedHash; use properties::{CSSWideKeyword, DeclaredValue}; use selector_map::{PrecomputedHashSet, PrecomputedDiagnosticHashMap}; @@ -246,15 +245,17 @@ impl ComputedValue { impl SpecifiedValue { /// Parse a custom property SpecifiedValue. pub fn parse<'i, 't>( - _context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result, ParseError<'i>> { let mut references = PrecomputedHashSet::default(); - let (first, css, last) = parse_self_contained_declaration_value(input, Some(&mut references))?; + + let (first_token_type, css, last_token_type) = + parse_self_contained_declaration_value(input, Some(&mut references))?; + Ok(Box::new(SpecifiedValue { css: css.into_owned(), - first_token_type: first, - last_token_type: last, + first_token_type, + last_token_type, references })) } diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 7de94c689d9..031bd1e580b 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1635,7 +1635,7 @@ impl PropertyDeclaration { // This probably affects some test results. let value = match input.try(|i| CSSWideKeyword::parse(i)) { Ok(keyword) => DeclaredValueOwned::CSSWideKeyword(keyword), - Err(()) => match ::custom_properties::SpecifiedValue::parse(context, input) { + Err(()) => match ::custom_properties::SpecifiedValue::parse(input) { Ok(value) => DeclaredValueOwned::Value(value), Err(e) => return Err(PropertyDeclarationParseError::InvalidValue(name.to_string().into(), ValueParseError::from_parse_error(e))), diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index 406f4beee3b..feb4e044c93 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -908,18 +908,18 @@ impl Parse for ColorStop { } impl Parse for PaintWorklet { - fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result> { + fn parse<'i, 't>( + _context: &ParserContext, + input: &mut Parser<'i, 't>, + ) -> Result> { input.expect_function_matching("paint")?; input.parse_nested_block(|input| { let name = Atom::from(&**input.expect_ident()?); let arguments = input.try(|input| { input.expect_comma()?; - input.parse_comma_separated(|input| Ok(*SpecifiedValue::parse(context, input)?)) + input.parse_comma_separated(|input| Ok(*SpecifiedValue::parse(input)?)) }).unwrap_or(vec![]); - Ok(PaintWorklet { - name: name, - arguments: arguments, - }) + Ok(PaintWorklet { name, arguments }) }) } }