commit 972e7bb6de6ca12e23a376a2146e84b94a4e5713
parent 3851b4f92a663e93b6425e2227921830013cdc36
Author: LearnPRG-py <aryankrishnan4b@gmail.com>
Date: Wed, 15 Oct 2025 08:22:51 +0000
Bug 1993608 [wpt PR 55327] - Blink: Fix unit conversion for relative oklch() angle components., a=testonly
Automatic update from web-platform-tests
Blink: Fix unit conversion for relative oklch() angle components.
This fix ensured the correct interpretation and conversion of the units
of colors in oklch().
The bug looked at a sample of these two identical colors background:
oklch(from blue .5 .3 180deg); background: oklch(from blue .5 .3
.5turn); While both of these colors should have been green (as on other
browsers). However, in Chrome, the top sample was green as expected
while the bottom sample was red.
This issue was traced to a missing conversion to degrees with
ComputeDegrees() in UnresolvedRelativeColor.
Bug: 449152900
Change-Id: I7208e2276e965848da5310c93f92c00e67b4ff22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7005776
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/main@{#1527475}
--
wpt-commits: 27c8a1b81bd2e58e52080b91898163f5d3b67c21
wpt-pr: 55327
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-color/parsing/color-computed-relative-color.html b/testing/web-platform/tests/css/css-color/parsing/color-computed-relative-color.html
@@ -620,6 +620,17 @@
fuzzy_test_computed_color(`oklch(from oklch(from oklch(0.7 0.45 30) l c h / calc(alpha + 0.5)) l c h / calc(alpha - 0.5))`, `oklch(0.7 0.45 30 / 0.5)`);
fuzzy_test_computed_color(`oklch(from oklch(from oklch(0.7 0.45 30) l c h / calc(alpha - 1.5)) l c h / calc(alpha + 0.5))`, `oklch(0.7 0.45 30 / 0.5)`);
+ // Testing unit conversion with relative colors
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 180deg)`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 .5turn)`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 3.14159rad)`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 200grad)`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 calc(120deg + 60deg))`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 calc(90deg + 1.5707rad))`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 calc(0.25turn + 100grad))`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 calc(180deg))`, `oklch(0.5 0.3 180)`);
+ fuzzy_test_computed_color(`oklch(from blue .5 .3 calc(0.2turn + 0.3turn))`, `oklch(0.5 0.3 180)`);
+
// Testing with 'none'.
fuzzy_test_computed_color(`oklch(from oklch(0.7 0.45 30) none none none)`, `oklch(none none none)`);
fuzzy_test_computed_color(`oklch(from oklch(0.7 0.45 30) none none none / none)`, `oklch(none none none / none)`);