Bug 221018

Summary: Add support for color(a98-rgb ...) as part of CSS Color 4
Product: WebKit Reporter: Sam Weinig <sam>
Component: CSSAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, simon.fraser, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 220928    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Sam Weinig 2021-01-26 16:10:57 PST
Add support for Adobe RGB 1998 and color(a98-rgb ...) as part of CSS Color 4 - https://www.w3.org/TR/css-color-4/#valdef-color-a98-rgb.
Comment 1 Sam Weinig 2021-01-26 16:33:36 PST Comment hidden (obsolete)
Comment 2 Sam Weinig 2021-01-26 16:53:04 PST Comment hidden (obsolete)
Comment 3 Darin Adler 2021-01-27 10:57:55 PST
Looked over the patch and it sure does look good. Wonder how this slightly changed the P3 results?
Comment 4 Sam Weinig 2021-01-27 11:03:19 PST
(In reply to Darin Adler from comment #3)
> Looked over the patch and it sure does look good. Wonder how this slightly
> changed the P3 results?

I swapped the matrix values between the p3 and a98-rgb conversion matrices :(. Classic copy and paste-o for me. I'm adding a few more tests and will re-upload with the fix.
Comment 5 Sam Weinig 2021-01-27 11:10:38 PST
Created attachment 418564 [details]
Patch
Comment 6 EWS Watchlist 2021-01-27 11:11:32 PST
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
Comment 7 Darin Adler 2021-01-27 17:03:45 PST
Comment on attachment 418564 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418564&action=review

> Source/WebCore/platform/graphics/ColorConversion.h:204
> +        return std::invoke(std::forward<Functor>(functor), makeFromComponents<SRGBA<T>>(components));

Wondering how to refine further to make the per-encoding as small as possible. Like, can the std::invoke be shared without hurting efficiency?

Really makes me wonder about the fundamental question: Practical way to map a runtime enumeration to a template name.

> Source/WebCore/platform/graphics/ColorTypes.h:34
> +template<typename> struct SRGBA;

I’m a big fan of alphabetizing such things rather than putting them in logical order. Would include AlphaTraits too.
Comment 8 EWS 2021-01-27 17:22:16 PST
Committed r271992: <https://trac.webkit.org/changeset/271992>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418564 [details].
Comment 9 Radar WebKit Bug Importer 2021-01-27 17:24:32 PST
<rdar://problem/73687600>