The color() function in CSS Color 4 - https://drafts.csswg.org/css-color/#color-function - specifies that component values less than 0% or greater than 100% are not invalid: "An out of gamut color has component values less than 0 or 0%, or greater than 1 or 100%. These are not invalid; instead, for display, they are gamut-mapped using a relative colorimetric intent which brings the values within the range 0/0% to 1/100% at computed-value time." I have some questions about what this means in practice, and if computed value time is the right time to gamut map rather than at use, and I will raise these with the spec editors.
<rdar://problem/87054230>
Created attachment 448744 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Created attachment 448751 [details] Patch
We have a bunch of test duplication with the WPT tests, but I will fix that in another change.
Comment on attachment 448751 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=448751&action=review > Source/WebCore/ChangeLog:8 > + Allow components outside the the 0-1 range for RGB color function types (e.g. color(srgb -2 15 100)). Is this only for code paths that already store the components as floating point values? Does this affect performance in any cases that before would round down to [0,255] integers?
(In reply to Darin Adler from comment #6) > Comment on attachment 448751 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=448751&action=review > > > Source/WebCore/ChangeLog:8 > > + Allow components outside the the 0-1 range for RGB color function types (e.g. color(srgb -2 15 100)). > > Is this only for code paths that already store the components as floating > point values? Does this affect performance in any cases that before would > round down to [0,255] integers? It's only for the code paths that we already store as float, no change to cases that before would round down to [0,255] integers.
Committed r287838 (245890@main): <https://commits.webkit.org/245890@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 448751 [details].