The CSS Color 3 spec. says that the computed value of the 'transparent' color keyword is 'rgba(0, 0, 0, 0)' and CSSOM defines the resolved value of several color properties returned by getComputedStyle() as the used value. CSS Color 4 even defines it as 'rgba(0 0 0 / 0)'. Gecko currently returns the 'transparent' keyword, though. So, this needs to be changed accordingly. This issue came up in bug 1063162 comment 72. According to Xidorn, the related code is very old. Sebastian  https://www.w3.org/TR/css3-color/#transparent-def  https://drafts.csswg.org/cssom/#resolved-values  https://drafts.csswg.org/css-color-4/#transparent-color  Bug 1063162 comment 74  https://dxr.mozilla.org/mozilla-central/rev/c91249f41e3766274131a84f9157a4d9d9949520/layout/style/nsComputedDOMStyle.cpp#973-976
Note that while it is clear in the spec that color properties should be serialized as the used value in getComputedStyle(), it isn't clear what the serialization is supposed to look like, and there is an open issue about that.  https://www.w3.org/TR/cssom-1/#resolved-values  https://github.com/w3c/csswg-drafts/issues/480
Oh, and we return 'transparent' for 'rgba(0, 0, 0, 0)' for specified value as well, which I guess worth fixing in this bug at the same time.
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1339394
You need to log in before you can comment on or make changes to this bug.