Bug 13236 - REGRESSION: Parsing of malformed CSS color shorthand properties results in invalid colors
Summary: REGRESSION: Parsing of malformed CSS color shorthand properties results in in...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P1 Normal
Assignee: Nobody
URL: http://webkit.wapuniverse.com/example...
Keywords: Regression
Depends on:
Blocks:
 
Reported: 2007-03-30 15:07 PDT by Donald C. Kirker
Modified: 2007-04-06 00:33 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Donald C. Kirker 2007-03-30 15:07:44 PDT
The attribute bgcolor="black''''" (seen in the body tag at http://webkit.wapuniverse.com/example.html) will result in a putrid green-yellow background instead of the black background seen in the release (and all nightlies before and including r13648). Other malformed color attributes (such as bgcolor="black-------") result in "bad" colors too. This also applies to <font color="... and is assumed to apply to all CSS color properties.

It is possible that these might be the results of the changes in r13673 (http://trac.webkit.org/projects/webkit/changeset/13673).
Comment 1 Darin Adler 2007-03-30 23:59:10 PDT
The code that does this is in StyledElement::addCSSColor.
Comment 2 Darin Adler 2007-03-31 00:01:15 PDT
(In reply to comment #0)
> This also applies to <font color="... and is assumed to apply to all CSS color properties.

It does not apply to CSS color properties. It only applies to element attributes that are implemented by mapping to CSS color properties.
Comment 3 Alexey Proskuryakov 2007-03-31 00:21:26 PDT
WinIE 6 and 7 give the same result. I suggest closing this as WONTFIX or INVALID.

From addCSSColor():
    // we're emulating IEs color parser here. It maps transparent to black, otherwise it tries to build a rgb value
    // out of everyhting you put in. The algorithm is experimentally determined, but seems to work for all test cases I have.
Comment 4 Alexey Proskuryakov 2007-03-31 04:59:45 PDT
Some more experimenting: with "<!DOCTYPE HTML>" or "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Strict//EN">" added to the test, Firefox and Opera give four different results (different shades of green, different parts of the page colorized).

WinIE appears to be consistent in all modes, and so does WebKit.