getComputedStyle() should return rgba(0, 0, 0, 0) for 'transparent' keyword

RESOLVED DUPLICATE of bug 1339394

Status

()

P3
normal
RESOLVED DUPLICATE of bug 1339394
2 years ago
5 months ago

People

(Reporter: sebo, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

2 years ago
The CSS Color 3 spec. says that the computed value of the 'transparent' color keyword is 'rgba(0, 0, 0, 0)'[1] and CSSOM defines the resolved value of several color properties returned by getComputedStyle() as the used value[2]. CSS Color 4 even defines it as 'rgba(0 0 0 / 0)'[3].

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[4], the related code[5] is very old.

Sebastian

[1] https://www.w3.org/TR/css3-color/#transparent-def
[2] https://drafts.csswg.org/cssom/#resolved-values
[3] https://drafts.csswg.org/css-color-4/#transparent-color
[4] Bug 1063162 comment 74
[5] https://dxr.mozilla.org/mozilla-central/rev/c91249f41e3766274131a84f9157a4d9d9949520/layout/style/nsComputedDOMStyle.cpp#973-976

Comment 1

2 years ago
Note that while it is clear in the spec[1] 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[2].

[1] https://www.w3.org/TR/cssom-1/#resolved-values
[2] 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.

Updated

2 years ago
Priority: -- → P3

Updated

6 months ago
Duplicate of this bug: 1439144
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.