DescriptionFrom https://code.google.com/p/google-caja/issues/detail?id=1491
> Run `sanitizeStylesheet(".test{background-image: linear-gradient(to bottom right, red, rgba(255,0,0,0));}", "prefix", function(u){return(u)})`
> The expected output is ".prefix .test{background-image: linear-gradient(to bottom right, red, rgba(255,0,0,0));}"
> However I receive ".prefix .test{}""
This change updates the schema and fixes a bug in sanitizecss.js that caused nested function calls to fail.
The function normalizeFunctionCall given the tokens
["name(", "foo", " ", "nested(", "bar", ")", ")"]
and the index of "name(" should have returned the index past the last close parenthesis since it should count parentheses to identify the parenthesis that closes the call-token at the beginning.
The paren-depth increment code looked for a token "(" though instead of a token like "nested(".
I also changed ormalizeFunction so that a token sequence like
["foo(", "bar", ";", "completely-different-property", ":", "value"]
doesn't treat the whole sequence as part of a broken "foo(" call.
----
Submitted at r5460
Patch Set 1 #
Total comments: 4
Patch Set 2 : Issue 1491: Add gradient support to CSS schema #Patch Set 3 : Issue 1491: Add gradient support to CSS schema #Patch Set 4 : Issue 1491: Add gradient support to CSS schema #
Total comments: 2
Patch Set 5 : Issue 1491: Add gradient support to CSS schema #Patch Set 6 : Issue 1491: Add gradient support to CSS schema #
MessagesTotal messages: 12
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||