Bug 221018 - Add support for color(a98-rgb ...) as part of CSS Color 4
Summary: Add support for color(a98-rgb ...) as part of CSS Color 4
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks: 220928
  Show dependency treegraph
 
Reported: 2021-01-26 16:10 PST by Sam Weinig
Modified: 2021-01-27 17:24 PST (History)
11 users (show)

See Also:


Attachments
Patch (42.79 KB, patch)
2021-01-26 16:33 PST, Sam Weinig
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (43.12 KB, patch)
2021-01-26 16:53 PST, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (58.29 KB, patch)
2021-01-27 11:10 PST, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>