diff --git a/src/parse/value/parse.rs b/src/parse/value/parse.rs index f1483cb..cbd72bc 100644 --- a/src/parse/value/parse.rs +++ b/src/parse/value/parse.rs @@ -11,7 +11,7 @@ use peekmore::{PeekMore, PeekMoreIterator}; use crate::{ builtin::GLOBAL_FUNCTIONS, color::{Color, NAMED_COLORS}, - common::{Brackets, Identifier, ListSeparator, Op, QuoteKind}, + common::{unvendor, Brackets, Identifier, ListSeparator, Op, QuoteKind}, error::SassResult, unit::Unit, utils::{ @@ -301,7 +301,7 @@ impl<'a> Parser<'a> { .span(span)); } else { // check for special cased CSS functions - match lower.as_str() { + match unvendor(&lower) { "calc" | "element" | "expression" => { s = lower; self.parse_calc_args(&mut s)?; diff --git a/tests/special-functions.rs b/tests/special-functions.rs index a60452b..8ec9a55 100644 --- a/tests/special-functions.rs +++ b/tests/special-functions.rs @@ -46,6 +46,11 @@ test!( "a {\n color: cAlC(1 + 1);\n}\n", "a {\n color: calc(1 + 1);\n}\n" ); +test!( + calc_browser_prefixed, + "a {\n color: -webkit-calc(1 + 2);\n}\n", + "a {\n color: -webkit-calc(1 + 2);\n}\n" +); test!( element_whitespace, "a {\n color: element( 1 );\n}\n", @@ -81,6 +86,11 @@ test!( element_nested_parens, "a {\n color: element((((()))));\n}\n" ); +test!( + element_browser_prefixed, + "a {\n color: -webkit-element(1 + 2);\n}\n", + "a {\n color: -webkit-element(1 + 2);\n}\n" +); test!( expression_whitespace, "a {\n color: expression( 1 );\n}\n", @@ -116,6 +126,11 @@ test!( expression_nested_parens, "a {\n color: expression((((()))));\n}\n" ); +test!( + expression_browser_prefixed, + "a {\n color: -webkit-expression(1 + 2);\n}\n", + "a {\n color: -webkit-expression(1 + 2);\n}\n" +); test!( progid_whitespace, "a {\n color: progid:( 1 );\n}\n", diff --git a/tests/url.rs b/tests/url.rs index 0373825..5228f07 100644 --- a/tests/url.rs +++ b/tests/url.rs @@ -134,6 +134,11 @@ test!( "a {\n color: UrL(http://foo);\n}\n", "a {\n color: url(http://foo);\n}\n" ); +test!( + url_browser_prefixed, + "a {\n color: -webkit-url(https://google.com);\n}\n", + "a {\n color: url(https://google.com);\n}\n" +); error!( url_nothing_after_forward_slash_in_interpolation, "a { color: url(#{/", "Error: Expected expression."