Bug 234711 - Support color interpolation methods for CSS Gradients
Summary: Support color interpolation methods for CSS Gradients
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-27 18:06 PST by Sam Weinig
Modified: 2021-12-28 12:38 PST (History)
10 users (show)

See Also:


Attachments
Patch (561.13 KB, patch)
2021-12-27 18:22 PST, Sam Weinig
no flags Details | Formatted Diff | Diff
Screenshot of gradient variations (1.03 MB, image/png)
2021-12-28 10:23 PST, Sam Weinig
no flags Details
Gradient Playground (2.69 KB, text/html)
2021-12-28 10:23 PST, Sam Weinig
no flags Details
Patch (385.15 KB, patch)
2021-12-28 11:35 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-12-27 18:06:43 PST
Support gradient interpolation methods for CSS Gradients
Comment 1 Sam Weinig 2021-12-27 18:22:51 PST
Created attachment 448016 [details]
Patch
Comment 2 Sam Weinig 2021-12-27 18:23:26 PST
No rendering tests yet, as those are proving tricky. Only parsing and serialization tests so far.
Comment 3 EWS Watchlist 2021-12-27 18:24:10 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 4 Sam Weinig 2021-12-28 10:23:25 PST
Created attachment 448050 [details]
Screenshot of gradient variations
Comment 5 Sam Weinig 2021-12-28 10:23:46 PST
Created attachment 448051 [details]
Gradient Playground
Comment 6 Sam Weinig 2021-12-28 10:25:11 PST
Attached playground to test out gradients with all the different interpolation methods at once. (It requires the patch and setting enabled to work).

Also added a screenshot of it working in MiniBrowser.
Comment 7 Simon Fraser (smfr) 2021-12-28 10:45:10 PST
Comment on attachment 448016 [details]
Patch

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

> LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-interpolation-method-valid-expected.txt:2
> +FAIL e.style['background-image'] = "linear-gradient(in srgb, red, blue)" should set the property value assert_equals: serialization should be canonical expected "linear-gradient(in srgb, red, blue)" but got "linear-gradient(red, blue)"

Why are these all fails?
Comment 8 Sam Weinig 2021-12-28 11:31:42 PST
(In reply to Simon Fraser (smfr) from comment #7)
> Comment on attachment 448016 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448016&action=review
> 
> > LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-interpolation-method-valid-expected.txt:2
> > +FAIL e.style['background-image'] = "linear-gradient(in srgb, red, blue)" should set the property value assert_equals: serialization should be canonical expected "linear-gradient(in srgb, red, blue)" but got "linear-gradient(red, blue)"
> 
> Why are these all fails?

Oh, cause I tried to simplify the test at the last moment and didn't double check things. I have the fix for this.

Thanks for the review.
Comment 9 Sam Weinig 2021-12-28 11:35:49 PST
Created attachment 448054 [details]
Patch
Comment 10 EWS 2021-12-28 12:37:35 PST
Committed r287474 (245609@main): <https://commits.webkit.org/245609@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448054 [details].
Comment 11 Radar WebKit Bug Importer 2021-12-28 12:38:20 PST
<rdar://problem/86963408>