[webkit-changes] [WebKit/WebKit] d26cb4: Fix failures in relative-color-out-of-gamut-expect...
Gerald Squelart
noreply at github.com
Sun Aug 11 15:30:03 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d26cb4ae7f44f61334632273de133bd18023b67d
https://github.com/WebKit/WebKit/commit/d26cb4ae7f44f61334632273de133bd18023b67d
Author: Gerald Squelart <g_squelart at apple.com>
Date: 2024-08-11 (Sun, 11 Aug 2024)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-out-of-gamut-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-out-of-gamut-expected.txt
M Source/WebCore/platform/graphics/ColorConversion.cpp
Log Message:
-----------
Fix failures in relative-color-out-of-gamut-expected due to rgbToHwb algorithm
https://bugs.webkit.org/show_bug.cgi?id=277538
rdar://133045692
Reviewed by Tim Nguyen.
The suggested rgbToHwb algorithm at https://drafts.csswg.org/css-color-4/#rgb-to-hwb
used to use rgbToHsl to compute the hue, discarding the saturation and lightness.
But rgbToHsl special-cases negative saturations (possible with out-of-gamut colors),
and flips the hue in that case, resulting in incorrect out-of-gamut HWB values.
This was fixed in https://github.com/w3c/csswg-drafts/pull/10718
This patch here replicates https://github.com/w3c/csswg-drafts/pull/10718 in the
equivalent WebKit function, it fixes failures in
relative-color-out-of-gamut-expected.html, but also in
color-mix-out-of-gamut-expected.html.
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-out-of-gamut-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-out-of-gamut-expected.txt:
* Source/WebCore/platform/graphics/ColorConversion.cpp:
(WebCore::ExtendedSRGBA<float>>::convert):
Canonical link: https://commits.webkit.org/282101@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list