LibWeb/CSS: Support the xyz-d65 colorspace in the color() function

This also adds support for `xyz` as it defaults to `xyz-d65`. We now
pass the following WPT tests:
 - css/css-color/xyz-001.html
 - css/css-color/xyz-002.html
 - css/css-color/xyz-004.html
 - css/css-color/xyz-d65-001.html
 - css/css-color/xyz-d65-002.html
 - css/css-color/xyz-d65-004.html
This commit is contained in:
Lucas CHOLLET 2024-10-27 14:02:10 -04:00 committed by Andreas Kling
commit 10dc7ff042
Notes: github-actions[bot] 2024-11-09 14:16:30 +00:00
8 changed files with 70 additions and 3 deletions

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: xyz</title>
<link rel="author" title="Sam Weinig" href="mailto:weinig@apple.com">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-xyz">
<link rel="match" href="../../../../expected/wpt-import/css/css-color/greensquare-ref.html">
<meta name="assert" content="xyz with no alpha">
<style>
.test { background-color: red; width: 12em; height: 12em; }
.test { background-color: color(xyz 0.07719 0.15438 0.02573); } /* green (sRGB #008000) converted to xyz */
</style>
<body>
<p>Test passes if you see a green square, and no red.</p>
<div class="test"></div>
</body>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: xyz</title>
<link rel="author" title="Sam Weinig" href="mailto:weinig@apple.com">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-xyz">
<link rel="match" href="../../../../expected/wpt-import/css/css-color/greensquare-ref.html">
<meta name="assert" content="xyz-d65 with no alpha">
<style>
.test { background-color: red; width: 12em; height: 12em; }
.test { background-color: color(xyz-d65 0.07719 0.15438 0.02573); } /* green (sRGB #008000) converted to xyz-d65 */
</style>
<body>
<p>Test passes if you see a green square, and no red.</p>
<div class="test"></div>
</body>