Bug 245552

Summary: Hue interpolation "specified" is not correctly implemented for hues < 0 or > 360
Product: WebKit Reporter: Sam Weinig <sam>
Component: CSSAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case
none
Existing top / With fix bottom none

Description Sam Weinig 2022-09-22 19:26:52 PDT
We currently normalize hues (for CSS color functions hsl(), hwb(), lch(), and oklch()) to aggressively, and should instead be deferring normalization (hue % 360) until necessary, either because a conversation or interpolation method requires it.

This should allow us to implement the "specified" hue interpolation method, which allows for the hue to circle the spectrum multiple times if necessary (i.e. 0 -> 720 would be two revolutions).
Comment 1 Sam Weinig 2022-09-22 19:40:11 PDT
Created attachment 462553 [details]
Test case
Comment 2 Sam Weinig 2022-09-22 19:41:39 PDT
Created attachment 462554 [details]
Existing top / With fix bottom
Comment 3 Radar WebKit Bug Importer 2022-09-23 16:11:23 PDT
<rdar://problem/100344615>
Comment 4 Sam Weinig 2022-09-23 16:24:25 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4654
Comment 5 EWS 2022-09-24 19:25:34 PDT
Committed 254833@main (cf0675f3297a): <https://commits.webkit.org/254833@main>

Reviewed commits have been landed. Closing PR #4654 and removing active labels.