Bug 45733 - <body bgcolor="currentColor"> should apply #c0e000
Summary: <body bgcolor="currentColor"> should apply #c0e000
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-14 00:40 PDT by Masataka Yakura
Modified: 2011-09-16 07:40 PDT (History)
3 users (show)

See Also:


Attachments
testcase. pass if the computed value of background-color is #c0e000. (151 bytes, text/html)
2010-09-14 00:40 PDT, Masataka Yakura
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masataka Yakura 2010-09-14 00:40:39 PDT
Created attachment 67524 [details]
testcase. pass if the computed value of background-color is #c0e000.

Some attributes like <font color> or <body bgcolor> can take color keywords. In HTML5, such keywords are limited to "transparent" and SVG color keywords defined in CSS3 Color module. Any strings other than these keywords would follow the "rules for parsing a legacy color value" http://whatwg.org/html5#rules-for-parsing-a-legacy-color-value

The keyword "currentColor" is also defined in css3-color, but in a different section from SVG Color keywords. Hence, if that keyword is specified in attributes which can take color keywords, it should follow the algorithm and return #c0e000, rather than the value of the "color" property, which is how the keyword is processed in CSS. However, WebKit does apply the value of the "color" property rather than #c0e000.
Comment 1 Aryeh Gregor 2011-04-08 14:47:55 PDT
Is this causing compat problems on any sites, or are you just noting that it doesn't match the spec?  Tab Atkins has suggested WebKit's behavior be standardized:

http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-April/031181.html
Comment 2 Masataka Yakura 2011-04-13 22:05:45 PDT
(In reply to comment #1)
> Is this causing compat problems on any sites, or are you just noting that it doesn't match the spec?  Tab Atkins has suggested WebKit's behavior be standardized:
> 
> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-April/031181.html

The latter (I was playing with WebKit's HTML5 parser and found it). I don't really think if there's any sites with <font color=currentcolor> or such...

For currentcolor: Trident behaves the same; Gecko seems to do what HTML5 suggests (converting "currentcolor" to #c0e000); Presto ignores the value. I don't have a strong opinion about which should be standard.
Comment 3 Masataka Yakura 2011-07-14 00:55:43 PDT
https://bugs.webkit.org/show_bug.cgi?id=63029 is fixed and it resolves this, too.
Comment 4 Alexey Proskuryakov 2011-07-14 08:45:35 PDT
Does this need to have a regression test landed?
Comment 5 Tab Atkins 2011-07-14 09:08:58 PDT
(In reply to comment #4)
> Does this need to have a regression test landed?

Probably, yes.  I can just fold this into the existing tests I added for #63029.
Comment 6 Alexey Proskuryakov 2011-07-14 09:25:30 PDT
Sounds good to me.
Comment 7 Alexey Proskuryakov 2011-09-16 00:37:14 PDT
Was it landed as part of bug 63029? I don't see such a subtest there.
Comment 8 Tab Atkins 2011-09-16 07:40:05 PDT
(In reply to comment #7)
> Was it landed as part of bug 63029? I don't see such a subtest there.

No, it was landed as part of bug 64576.