1
Vote

Vendor specific RGB function name in CSS causes an infinite loop

description

Parsing RGB function prefixed by a vendor prefix causes the parser to end up in an infinite loop.
.content {
background: -webkit-rgb(0, 10, 20);
}
The problem seems to be related to the CssParser.ParseFunction method. Firstly, it calls:
var functionText = GetRoot(CurrentTokenText);
which properly separates the vendor prefix from the rgb function name. However, the consequent call to ParseRgb does not utilize the result of the GetRoot function and internally performs the following comparison:
if (CurrentTokenType == TokenType.Function && string.Compare(CurrentTokenText, "rgb(", StringComparison.OrdinalIgnoreCase) == 0)
which evalueates to False as CurrentTokenText contains the vendor prefix.

comments