Implement lab(), lch(), oklab() and oklch() from CSS Color Module Level 4
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: sebo, Assigned: tlouw)
References
(Blocks 5 open bugs, )
Details
(Keywords: dev-doc-complete, Whiteboard: [layout:backlog])
Attachments
(1 file, 2 obsolete files)
Updated•8 years ago
|
Reporter | ||
Updated•8 years ago
|
Updated•8 years ago
|
Updated•7 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
webkit bug: https://bugs.webkit.org/show_bug.cgi?id=205675
Updated•5 years ago
|
Updated•5 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Some initial comments after first investigation:
- In the rust-cssparser library (that does the parsing only) assumes that all color spaces will be converted back to rgb. According to some comments from webkit bug and also looking at the styles and animation code it looks like we should rather just pass the values back to the consumer of the lib in the formats that is being parsed. So in stead of RGB we return {r, g, b}, {l, a, b}, {l, c, h}, {h, s, l}, etc.
- The second problem is that the conversion functions used in css-color-5 is mostly implemented in gecko already and we don't have access to those from rust-cssparser. Having to convert to RGB would require a duplication of the code or extracting the conversion functions to separate lib. (Which is not a bad idea in general I think. Really handy functions)
Choosing whether to convert to sRGB or to store the parsed values is an implementation detail provided that extended-range sRGB is being converted to/from (ie values <0 and >1.0 are preserved). Modulo some round-trip error of course.
Since the original bug was filed, CSS Color 4 has added oklab() and oklch() which are significantly better than Lab/LCH in terms of perceptual uniformity, are used for gradient interpolation and gamut mapping, and also don't require chromatic adaptation between D65 and D50 white points which is another source of cumulative round-off error.
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D163450
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D163450
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Similar to guidance on :has in https://bugzilla.mozilla.org/show_bug.cgi?id=418039#c62, may we know roughly when Firefox intends to ship this?
Comment 10•2 years ago
|
||
Assignee | ||
Comment 11•2 years ago
|
||
(In reply to Alexandre Dieulot from comment #9)
Similar to guidance on :has in https://bugzilla.mozilla.org/show_bug.cgi?id=418039#c62, may we know roughly when Firefox intends to ship this?
We are actively working on some color-4 improvements and you can expect a release in the coming months.
Comment 12•2 years ago
|
||
Backed out for causing failures on test_transitions_per_property.html.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=402896632&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/2324abe2eb7c71666c6adc98d377bfa4fe71a731
Comment 13•2 years ago
|
||
Comment 15•2 years ago
|
||
bugherder |
Assignee | ||
Comment 16•2 years ago
|
||
These changes are currently under the layout.css.more_color_4.enabled
preference.
Comment 17•2 years ago
|
||
Documentation changes for this are being tracked in the following issue on GitHub: https://github.com/mdn/content/issues/24395
Updated•2 years ago
|
Comment 18•2 years ago
|
||
[Updating bug title to reflect the fact that we implemented oklab() and oklch() here as well. Also, closing stale needinfo for emilio from back before this bug had an assignee.]
Description
•