From 70ea5f61a2fdecd89f869b7303c5262d2867795d Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 7 Sep 2015 17:28:03 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20ignore=20input=20at=20the=20end?= =?UTF-8?q?=20of=20a=20declaration=20with=20var().?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/style/properties.mako.rs | 35 ++++++++++--------- .../html/variable-declaration-24.htm.ini | 3 -- 2 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-24.htm.ini diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 7bb31d0fc5b..a9f9b92156b 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -5615,24 +5615,25 @@ mod property_bit_field { // As of this writing, only the base URL is used for property values: let context = ParserContext::new( ::stylesheets::Origin::Author, base_url); - let mut input = Parser::new(&css); - match from_shorthand { - Shorthand::None => { - longhands::${property.ident}::parse_specified(&context, &mut input) + Parser::new(&css).parse_entirely(|input| { + match from_shorthand { + Shorthand::None => { + longhands::${property.ident}::parse_specified(&context, input) + } + % for shorthand in SHORTHANDS: + % if property in shorthand.sub_properties: + Shorthand::${shorthand.camel_case} => { + shorthands::${shorthand.ident}::parse_value(&context, input) + .map(|result| match result.${property.ident} { + Some(value) => DeclaredValue::Value(value), + None => DeclaredValue::Initial, + }) + } + % endif + % endfor + _ => unreachable!() } - % for shorthand in SHORTHANDS: - % if property in shorthand.sub_properties: - Shorthand::${shorthand.camel_case} => { - shorthands::${shorthand.ident}::parse_value(&context, &mut input) - .map(|result| match result.${property.ident} { - Some(value) => DeclaredValue::Value(value), - None => DeclaredValue::Initial, - }) - } - % endif - % endfor - _ => unreachable!() - } + }) }) .unwrap_or( // Invalid at computed-value time. diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-24.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-24.htm.ini deleted file mode 100644 index ba980233612..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-24.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-declaration-24.htm] - type: reftest - expected: FAIL