Skip to content

Commit

Permalink
Bug 1794701 [wpt PR 36404] - Add tests for not resolving colors in co…
Browse files Browse the repository at this point in the history
…lor-mix function, a=testonly

Automatic update from web-platform-tests
Add tests for not resolving colors in color-mix function

From the discussion here:
w3c/csswg-drafts#7302

Keyword colors shouldn't be resolved as specified colors.

Bug: 1362022
Change-Id: I3e4f3dd7220ac84777a1edddd54f87ead217d6b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3945930
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Reviewed-by: Juanmi Huertas <juanmihd@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1066591}

--

wpt-commits: a9e397396e32d91d52344ea61ea3bdd5c361dcf5
wpt-pr: 36404
  • Loading branch information
mysteryDate authored and moz-wptsync-bot committed Nov 11, 2022
1 parent e5c53ab commit 15f3494
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
<body>
<div id="target"></div>
<script>
// https://github.com/w3c/csswg-drafts/issues/7302: Specified values shouldn't resolve keyword colors or calc values
test_valid_value(`color`, `color-mix(in srgb, red, blue)`, `color-mix(in srgb, red, blue)`);
test_valid_value(`color`, `color-mix(in hsl, red, blue)`, `color-mix(in hsl, red, blue)`);
test_valid_value(`color`, `color-mix(in hsl, red calc(20%), blue)`, `color-mix(in hsl, red calc(20%), blue)`);
test_valid_value(`color`, `color-mix(in hsl, red calc(var(--v)*1%), blue)`, `color-mix(in hsl, red calc(var(--v)*1%), blue)`);
test_valid_value(`color`, `color-mix(in hsl, currentcolor, blue)`, `color-mix(in hsl, currentcolor, blue)`);
test_valid_value(`color`, `color-mix(in hsl, red 60%, blue 40%)`, `color-mix(in hsl, red 60%, blue 40%)`);
test_valid_value(`color`, `color-mix(in lch decreasing hue, red, hsl(120, 100%, 50%))`, `color-mix(in lch decreasing hue, red, rgb(0, 255, 0))`);

test_valid_value(`color`, `color-mix(in hsl, hsl(120deg 10% 20%), hsl(30deg 30% 40%))`, `color-mix(in hsl, rgb(46, 56, 46), rgb(133, 102, 71))`);
test_valid_value(`color`, `color-mix(in hsl, hsl(120deg 10% 20%) 25%, hsl(30deg 30% 40%))`, `color-mix(in hsl, rgb(46, 56, 46) 25%, rgb(133, 102, 71))`);
test_valid_value(`color`, `color-mix(in hsl, 25% hsl(120deg 10% 20%), hsl(30deg 30% 40%))`, `color-mix(in hsl, rgb(46, 56, 46) 25%, rgb(133, 102, 71))`);
Expand Down

0 comments on commit 15f3494

Please sign in to comment.