[webkit-reviews] review requested: [Bug 15360] color:#{predefined colorName} is okay in Safari : [Attachment 22774] Potential patch for bug 15360

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 13 09:01:04 PDT 2008


Glenn Wilson <wilsong at gmail.com> has asked  for review:
Bug 15360: color:#{predefined colorName} is okay in Safari
https://bugs.webkit.org/show_bug.cgi?id=15360

Attachment 22774: Potential patch for bug 15360
https://bugs.webkit.org/attachment.cgi?id=22774&action=edit

------- Additional Comments from Glenn Wilson <wilsong at gmail.com>
In the bison template CSSGrammar.y, "hexcolor" was defined as both "HEX
maybe_space" OR "IDENT maybe_space".  This caused identifiers not fitting the
appropriate hex format, but preceeded by a '#', to be interpreted as a valid
color (CSSPrimitiveValue::CSS_PARSER_HEXCOLOR), when it was really just an
ignorable token.

To correct this, "IDENT maybe_space" was removed from "hexcolor" and added
under "term" as "'#' IDENT maybe_space", which is then processed as a
CSSPrimitiveValue::CSS_STRING instead of
CSSPrimitiveValue::CSS_PARSER_HEXCOLOR.  Thus, the value will still be
processable in CSSParser in the future, but as a CSS_STRING and not a
CSS_PARSER_HEXCOLOR or CSS_PARSER_IDENT.

"IDENT maybe_space" is already being matched earlier in "term", and "'#'
maybe_space" is matched after, so both edge cases are already being matched.

The expected value for the layout test is added under platform/win right now,
but I'd also like to be able to add the expected value for platform/mac next.


More information about the webkit-reviews mailing list