Skip to content

Commit

Permalink
Bug 1893818 [wpt PR 45941] - [css-color] Tests assume old hsl()/hsla(…
Browse files Browse the repository at this point in the history
…) clipping behavior or depend on unclear gamut mapping to sRGB, a=testonly

Automatic update from web-platform-tests
[css-color] Tests assume old hsl()/hsla() clipping behavior or depend on unclear gamut mapping to sRGB (#45941)

web-platform-tests/wpt#45814

Removes tests that were assuming the CSS Color 3 rules for hsl()/hsla()
where lightness and saturation values outside of 0-100 were clamped to
that range. CSS Color 4 states that only saturation below 0 is clamped.

To make it clear that only the saturation clamping is being tested, the
tests where that is still tested have been renamed to be more clear.
--

wpt-commits: fd6e317871ed6baeedfe25b03b79b73eb898d15c
wpt-pr: 45941
  • Loading branch information
weinig authored and moz-wptsync-bot committed May 2, 2024
1 parent 9fbda4f commit 8e6635b
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,12 @@
td { border: none; padding: 0; height: 1.2em; }
</style>
<body>
<p><strong>WARNING: This test assumes that the device gamut is sRGB
(as it will be for many CRT monitors).</strong></p>
<p>Every row in this table should have both columns the same color:</p>
<table>
<tr>
<th style="background:white; color: black">Column 1</th>
<th style="background:black; color: white">Column 2</th>
</tr>
<tr>
<td colspan='2' style="background: black">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: black">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: white">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(0, 0, 255)">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(102, 0, 255)">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(102, 102, 102)">&nbsp;</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: hsl() clamp negative saturation values</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
<link rel="help" href="https://www.w3.org/TR/css-color-4/#the-hsl-notation" />
<link rel="match" href="hsl-clamp-negative-saturation-ref.html" />
<meta name="assert" content="Test clamping of negative saturation values in hsl() functions." />
<style type="text/css">

table { border-spacing: 0 2px; padding: 0; border: none; }
td { border: none; padding: 0; height: 1.2em; }

</style>
</head>
<body>

<p>Every row in this table should have both columns the same color:</p>

<table>
<tr>
<th style="background:white; color: black">Column 1</th>
<th style="background:black; color: white">Column 2</th>
</tr>
<tr>
<td style="background: hsl(0, -50%, 40%)">&nbsp;</td>
<td style="background: rgb(102, 102, 102)">&nbsp;</td>
</tr>
<tr>
<td style="background: hsl(30, -50%, 60%)">&nbsp;</td>
<td style="background: rgb(153, 153, 153)">&nbsp;</td>
</tr>
</table>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,12 @@
td { border: none; padding: 0; height: 1.2em; }
</style>
<body>
<p><strong>WARNING: This test assumes that the device gamut is sRGB
(as it will be for many CRT monitors).</strong></p>
<p>Every row in this table should have both columns the same color:</p>
<table>
<tr>
<th style="background:white; color: black">Column 1</th>
<th style="background:black; color: white">Column 2</th>
</tr>
<tr>
<td colspan='2' style="background: rgb(102, 102, 102)">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(153, 153, 153)">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: white">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(153, 153, 255)">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(163, 102, 255)">&nbsp;</td>
</tr>
<tr>
<td colspan='2' style="background: rgb(194, 194, 194)">&nbsp;</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: hsla() clamp negative saturation values</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
<link rel="help" href="https://www.w3.org/TR/css-color-4/#the-hsl-notation" />
<link rel="match" href="hsla-clamp-negative-saturation-ref.html" />
<meta name="assert" content="Test clamping of negative saturation values in hsla() functions." />
<style type="text/css">

body { background: white; color: black; }
table { border-spacing: 0 2px; padding: 0; border: none; }
td { border: none; padding: 0; height: 1.2em; }

</style>
</head>
<body>

<p>Every row in this table should have both columns the same color:</p>

<table>
<tr>
<th style="background:white; color: black">Column 1</th>
<th style="background:black; color: white">Column 2</th>
</tr>
<tr>
<td style="background: hsla(0, -50%, 40%, 0.4)">&nbsp;</td>
<td style="background: rgb(194, 194, 194)">&nbsp;</td>
</tr>
<tr>
<td style="background: hsla(30, -50%, 60%, 0.6)">&nbsp;</td>
<td style="background: rgb(194, 194, 194)">&nbsp;</td>
</tr>
</table>

</body>
</html>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,12 @@
('hsl-4', 'hsl(-360240, 100%, 50%)', 0,255,0,255, ""),
('hsl-5', 'hsl(120.0, 100.0%, 50.0%)', 0,255,0,255, ""),
('hsl-6', 'hsl(+120, +100%, +50%)', 0,255,0,255, ""),
('hsl-clamp-1', 'hsl(120, 200%, 50%)', 0,255,0,255, ""),
('hsl-clamp-2', 'hsl(120, -200%, 49.9%)', 127,127,127,255, ""),
('hsl-clamp-3', 'hsl(120, 100%, 200%)', 255,255,255,255, ""),
('hsl-clamp-4', 'hsl(120, 100%, -200%)', 0,0,0,255, ""),
('hsl-clamp-negative-saturation', 'hsl(120, -200%, 49.9%)', 127,127,127,255, ""),
('hsla-1', 'hsla(120, 100%, 50%, 0.499)', 0,255,0,127, ""),
('hsla-2', 'hsla( 120.0 , 100.0% , 50.0% , 1 )', 0,255,0,255, ""),
('hsla-clamp-1', 'hsla(120, 200%, 50%, 1)', 0,255,0,255, ""),
('hsla-clamp-2', 'hsla(120, -200%, 49.9%, 1)', 127,127,127,255, ""),
('hsla-clamp-3', 'hsla(120, 100%, 200%, 1)', 255,255,255,255, ""),
('hsla-clamp-4', 'hsla(120, 100%, -200%, 1)', 0,0,0,255, ""),
('hsla-clamp-5', 'hsla(120, 100%, 50%, 2)', 0,255,0,255, ""),
('hsla-clamp-6', 'hsla(120, 100%, 0%, -2)', 0,0,0,0, ""),
('hsla-clamp-negative-saturation', 'hsla(120, -200%, 49.9%, 1)', 127,127,127,255, ""),
('hsla-clamp-alpha-1', 'hsla(120, 100%, 50%, 2)', 0,255,0,255, ""),
('hsla-clamp-alpha-2', 'hsla(120, 100%, 0%, -2)', 0,0,0,0, ""),
('svg-1', 'gray', 128,128,128,255, ""),
('svg-2', 'grey', 128,128,128,255, ""),
# css-color-4 rgb() color function
Expand Down

0 comments on commit 8e6635b

Please sign in to comment.