From 54ef8055ec67b2eb72a76f66bb678f0d619ae6e9 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 7 Sep 2015 17:00:36 +0200 Subject: [PATCH] The function name var() is case-insensitive. --- components/style/custom_properties.rs | 5 +++-- .../css-variables-1_dev/html/variable-reference-20.htm.ini | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-20.htm.ini diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index eda03ecfe23..c593feb1a6c 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -4,6 +4,7 @@ use cssparser::{Parser, Token, SourcePosition, Delimiter}; use properties::DeclaredValue; +use std::ascii::AsciiExt; use std::collections::{HashMap, HashSet}; use std::sync::Arc; use string_cache::Atom; @@ -73,7 +74,7 @@ fn parse_declaration_value_block(input: &mut Parser, references: &mut Option { + Token::Function(ref name) if name.eq_ignore_ascii_case("var") => { try!(input.parse_nested_block(|input| { parse_var_function(input, references) })); @@ -287,7 +288,7 @@ fn substitute_block(input: &mut Parser, let before_this_token = input.position(); let token = if let Ok(token) = input.next() { token } else { break }; match token { - Token::Function(ref name) if name == "var" => { + Token::Function(ref name) if name.eq_ignore_ascii_case("var") => { substituted.push_str(input.slice(*start..before_this_token)); try!(input.parse_nested_block(|input| { // parse_var_function() ensures neither .unwrap() will fail. diff --git a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-20.htm.ini b/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-20.htm.ini deleted file mode 100644 index 4ab2b3816af..00000000000 --- a/tests/wpt/metadata-css/css-variables-1_dev/html/variable-reference-20.htm.ini +++ /dev/null @@ -1,3 +0,0 @@ -[variable-reference-20.htm] - type: reftest - expected: FAIL