[css-color] Relative color syntax doesn't support the currentcolor keyword as origin color
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox133 | --- | fixed |
People
(Reporter: tlouw, Assigned: tlouw)
References
(Blocks 1 open bug)
Details
(Keywords: parity-safari)
Attachments
(1 file)
Right now currentcolor is resolved as BLACK to get the values from the origin color.
Currentcolor and other non-absolute origin colors should be preserved in the specified/calculated value until it can be resolved to absolute when a "color" is available.
Updated•1 year ago
|
Comment 2•1 year ago
•
|
||
I'm guessing this is related to the various relative-currentcolor-* failures that we have, right?
wpt.fyi:
https://wpt.fyi/results/css/css-color/relative-currentcolor-a98rgb-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-displayp3-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-hsl-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-hsl-02.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-hsl-02.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-lab-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-lch-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-oklab-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-oklch-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-prophoto-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-rec2020-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-rec2020-02.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-rgb-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-rgb-02.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-xyzd50-01.html
https://wpt.fyi/results/css/css-color/relative-currentcolor-xyzd65-01.html
They use syntax like...
background-color: color(from currentColor rec2020 r g b);
...which ends up rendering as black in the testcases that I looked at (and they get the rendering correct if I swap currentColor for green).
Comment 3•1 year ago
•
|
||
I used wpt.fyi "triage mode" to link up all of the tests in comment 2 to this bug.
I think our failures here are also mostly from this bug too, so I linked those up as well:
https://wpt.fyi/results/css/css-color/parsing/color-valid-relative-color.html
(filtered for failures: https://wpt.fyi/results/css/css-color/parsing/color-valid-relative-color.html?q=firefox%3Afail )
Specifically, 18 out of our 20 subtest-failures in that test are for syntax that involves from currentColor. (The other 2 subtest failures are for hsl(from rebeccapurple none none none / none) and the same value but with hsla; and all browsers currently fail those 2 subtests, FWIW.)
Comment 4•1 year ago
|
||
(FWIW Chrome just fixed their version of this bug, in https://issues.chromium.org/issues/325309578 , and I guess WebKit fixed their version a few months back in https://bugs.webkit.org/show_bug.cgi?id=245970 / https://github.com/WebKit/WebKit/pull/28445 .)
Updated•1 year ago
|
Comment 5•1 year ago
•
|
||
Tiaan, I think this is on your radar to take at some point -- if you can, it might be nice to front-load it ahead of grid interop fixes, since this one is responsible for such an outsized interop score bump.
(Chrome's fix for this one bug took them from ~15% to 95% in their interop-2024-relative-color score, and from 93.1% to 97.8% in overall score. This is a +80% delta in the relative-color category, and a 4.7% delta in the top-line interop-2024 score.)
Comment 6•1 year ago
•
|
||
FWIW, with that implemented, the overall interop score will also jump above 90% from currently 86%.
Sebastian
| Assignee | ||
Comment 8•1 year ago
|
||
This is an accumulation of all the changes to tests made by the patches
in this stack.
color-invalid-relative-color.html.ini tests that percentages are used
correctly inside calc(..) nodes. There are some edge cases we are not
passing. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1894263
relative-color-out-of-gamut.html.ini does conversions from an out of
gamma color to the rgb(..) syntax. Relative colors should not use the
rgb(..) syntax any more, but the color(srgb ..) syntax instead. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1921766
color-computed-relative-color.html.ini has some errors where the
none keyword is not forwarded from the origin color to the final
color according to the spec. It also has the same out of gamma tests
that is in relative-color-out-of-gamut.html.ini. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1899009 which is
dependent on clarification of the spec here:
https://github.com/w3c/csswg-drafts/issues/10360
color-valid-relative-color.html.ini contains serialization
discrepencies where the calc(..) keyword is used if the origin values
were specified with calc(..), but according to the color spec, the
calc(..) is not needed for color components. These tests are dependent
on the outcome of:
https://github.com/web-platform-tests/wpt/issues/47921
Updated•1 year ago
|
Comment 10•1 year ago
|
||
| bugherder | ||
Description
•