diff --git a/src/value/parse.rs b/src/value/parse.rs index 20646c9..5b2ca2f 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -529,6 +529,7 @@ impl Value { let lower = s.to_ascii_lowercase(); if lower == "progid" && toks.peek().is_some() && toks.peek().unwrap().kind == ':' { + s = lower; toks.next(); s.push(':'); s.push_str(&eat_progid(toks, scope, super_selector)?); @@ -555,6 +556,7 @@ impl Value { None => { match lower.as_str() { "calc" | "element" | "expression" => { + s = lower; eat_calc_args(toks, scope, super_selector, &mut s)?; } // "min" => {} diff --git a/tests/special-functions.rs b/tests/special-functions.rs index 82fe561..a60452b 100644 --- a/tests/special-functions.rs +++ b/tests/special-functions.rs @@ -36,6 +36,16 @@ test!( calc_invalid_arithmetic, "a {\n color: calc(2px + 2px + 5%);\n}\n" ); +test!( + calc_uppercase, + "a {\n color: CALC(1 + 1);\n}\n", + "a {\n color: calc(1 + 1);\n}\n" +); +test!( + calc_mixed_casing, + "a {\n color: cAlC(1 + 1);\n}\n", + "a {\n color: calc(1 + 1);\n}\n" +); test!( element_whitespace, "a {\n color: element( 1 );\n}\n", @@ -149,3 +159,13 @@ error!( progid_number_after_colon, "a {\n color: progid:ap1ple.bottoM..jeans.boots();\n}\n", "Error: expected \"(\"." ); +test!( + progid_uppercase, + "a {\n color: PROGID:foo(fff);\n}\n", + "a {\n color: progid:foo(fff);\n}\n" +); +test!( + progid_mixed_casing, + "a {\n color: PrOgId:foo(fff);\n}\n", + "a {\n color: progid:foo(fff);\n}\n" +); diff --git a/tests/url.rs b/tests/url.rs index ed0bf2c..a83b3c3 100644 --- a/tests/url.rs +++ b/tests/url.rs @@ -124,3 +124,13 @@ test!( "a {\n color:url(;);\n}\n", "a {\n color: url(;);\n}\n" ); +test!( + url_uppercase, + "a {\n color: URL(http://foo);\n}\n", + "a {\n color: url(http://foo);\n}\n" +); +test!( + url_mixed_casing, + "a {\n color: UrL(http://foo);\n}\n", + "a {\n color: url(http://foo);\n}\n" +);