[Webkit-unassigned] [Bug 21680] queryCommandValue("BackColor") returns rgb(0, 0, 0) for elements with transparent background

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 8 22:37:28 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=21680





--- Comment #11 from Ryosuke Niwa <rniwa at webkit.org>  2010-07-08 22:37:28 PST ---
I ran the latest tests on Firefox and Internet Explorer to see their behaviors.

Internet Explorer returns rgb(0, 0, 0) for mixed background colors.  e.g. <div style='background: green;' id=test><span style='background-color: yellow'>hello</span><span style='background-color: blue'> world</span></div> gives rgb(0,0,0) when #test is selected.

In other cases, IE retrieves the effective background color. For <div style='background: green;' id=test><span style='background-color: yellow'>hello</span><span style='background-color: yellow'> world</span></div>, IE returns yellow (in RGB form).

Firefox does something somewhat simpler.  It retrieves the background color of the node selected, and traverses ancestor nodes while the background color of the selected node is transparent.  So <div style='background: green;' id=test><span style='background-color: yellow'>hello</span><span style='background-color: blue'> world</span></div> AND <div style='background: green;' id=test><span style='background-color: yellow'>hello</span><span style='background-color: yellow'> world</span></div> BOTH gives green.

It seems like IE is doing a good job in terms of what user would expect but I'm not sure if we should return black in the case of mixed background color. Ojan & Julie, any thoughts on this?

Also, during the debugging, I found that CSSComputedStyleDeclaration always returns RGBA (RGB+Alpha value) for CSSPropertyBackgroundColor regardless of whether it's transparent or not.  So in the case of a node with background-color: transparent, we still get rgba(0,0,0,0).  It seems like we need to special case this value or modify the computed style to return CSSValueTransparent.  Does anyone know with whom I should talk about this issue?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list