From ab9e1af20650509382ea21527909ee3086d78031 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 7 Sep 2015 16:48:07 +0200 Subject: [PATCH] Allow whitespace-only custom property values. --- components/style/custom_properties.rs | 7 +++++-- .../html/variable-declaration-08.htm.ini | 3 --- .../html/variable-declaration-26.htm.ini | 3 --- .../html/variable-declaration-37.htm.ini | 3 --- .../css-variables-1_dev/html/variable-reference-03.htm.ini | 3 --- .../css-variables-1_dev/html/variable-reference-04.htm.ini | 3 --- .../css-variables-1_dev/html/variable-reference-26.htm.ini | 3 --- .../css-variables-1_dev/html/variable-reference-27.htm.ini | 3 --- 8 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-08.htm.ini delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-26.htm.ini delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-37.htm.ini delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-03.htm.ini delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-04.htm.ini delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-26.htm.ini delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-27.htm.ini diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 057b7c27ce4..eda03ecfe23 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -48,10 +48,13 @@ pub fn parse(input: &mut Parser) -> Result { pub fn parse_declaration_value(input: &mut Parser, references: &mut Option>) -> Result<(), ()> { input.parse_until_before(Delimiter::Bang | Delimiter::Semicolon, |input| { - if input.is_exhausted() { - // Need at least one token + // Need at least one token + let start_position = input.position(); + if input.next_including_whitespace().is_err() { return Err(()) } + input.reset(start_position); + parse_declaration_value_block(input, references) }) } diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-08.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-08.htm.ini deleted file mode 100644 index 83e66d3a80e..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-08.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-declaration-08.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-26.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-26.htm.ini deleted file mode 100644 index 98c918745b5..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-26.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-declaration-26.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-37.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-37.htm.ini deleted file mode 100644 index 6c8b66e14c0..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-declaration-37.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-declaration-37.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-03.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-03.htm.ini deleted file mode 100644 index d845cc12cd8..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-03.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-reference-03.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-04.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-04.htm.ini deleted file mode 100644 index fba032c2710..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-04.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-reference-04.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-26.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-26.htm.ini deleted file mode 100644 index ebd0652279f..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-26.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-reference-26.htm] - type: reftest - expected: FAIL diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-27.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-27.htm.ini deleted file mode 100644 index 8a36f19f2e7..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-27.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-reference-27.htm] - type: reftest - expected: FAIL