[webkit-reviews] review granted: [Bug 15360] Invalid color #{predefined colorName} is accepted by the CSS parser. : [Attachment 88275] proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 6 07:08:25 PDT 2011

Darin Adler <darin at apple.com> has granted Andras Becsi <abecsi at webkit.org>'s
request for review:
Bug 15360: Invalid color #{predefined colorName} is accepted by the CSS parser.

Attachment 88275: proposed patch

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=88275&action=review

It’s kind of wasteful that the CSS parser already knows it’s hex in the
hexcolor case, but still does so much work to process other color formats. Not
new, of course, but could be so much more efficient given the lexer has already
told us it's a hex number.

> Source/WebCore/css/tokenizer.flex:49
> +"#"{hexnum}		   {yyTok = HEX; return yyTok;}

I think {h}+ would read just as well as {hexnum} if not better, so I don’t
think we really need hexnum.

More information about the webkit-reviews mailing list