<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[286168] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/286168">286168</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2021-11-25 07:24:49 -0800 (Thu, 25 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Color 4] Add support for new srgb-linear, xyz-d50 and xyz-d65 colorspaces
https://bugs.webkit.org/show_bug.cgi?id=233475

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update existing color(xyz ...) tests for new d65 whitepoint and add new tests
for color(srgb-linear ...), color(xyz-d50 ...) and color(xyz-d65 ...).

* web-platform-tests/css/css-color/predefined-016.html:
* web-platform-tests/css/css-color/srgb-linear-001-expected.html: Added.
* web-platform-tests/css/css-color/srgb-linear-001.html: Added.
* web-platform-tests/css/css-color/srgb-linear-002-expected.html: Added.
* web-platform-tests/css/css-color/srgb-linear-002.html: Added.
* web-platform-tests/css/css-color/srgb-linear-003-expected.html: Added.
* web-platform-tests/css/css-color/srgb-linear-003.html: Added.
* web-platform-tests/css/css-color/srgb-linear-004-expected.html: Added.
* web-platform-tests/css/css-color/srgb-linear-004.html: Added.
* web-platform-tests/css/css-color/xyz-001.html:
* web-platform-tests/css/css-color/xyz-003-expected.html:
* web-platform-tests/css/css-color/xyz-003.html:
* web-platform-tests/css/css-color/xyz-004-expected.html:
* web-platform-tests/css/css-color/xyz-004.html:
* web-platform-tests/css/css-color/xyz-005.html:
* web-platform-tests/css/css-color/xyz-d50-001-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d50-001.html: Added.
* web-platform-tests/css/css-color/xyz-d50-002-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d50-002.html: Added.
* web-platform-tests/css/css-color/xyz-d50-003-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d50-003.html: Added.
* web-platform-tests/css/css-color/xyz-d50-004-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d50-004.html: Added.
* web-platform-tests/css/css-color/xyz-d50-005-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d50-005.html: Added.
* web-platform-tests/css/css-color/xyz-d65-001-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d65-001.html: Added.
* web-platform-tests/css/css-color/xyz-d65-002-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d65-002.html: Added.
* web-platform-tests/css/css-color/xyz-d65-003-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d65-003.html: Added.
* web-platform-tests/css/css-color/xyz-d65-004-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d65-004.html: Added.
* web-platform-tests/css/css-color/xyz-d65-005-expected.html: Added.
* web-platform-tests/css/css-color/xyz-d65-005.html: Added.

Source/WebCore:

Updates existing tests to add cases for the new colorspaces.

- Adds support for color(srgb-linear ...), color(xyz-d50 ...) and color(xyz-d65 ...)
- Updates color(xyz ...) to be an alias of color(xyz-d65 ...), which is a breaking change
  both because previously it used the d50 white point and because we now serialize it
  as color(xyz-d65 ...). We think this is acceptable as we just shipped the feature and
  no other browsers yet support it.
- Adds support for color-mix(in xyz-d50, ...) and color-mix(in xyz-d65, ...).
- Updates color-mix(in xyz, ...) to use the d65 white point (like above). We have not shipped
  color-mix enabled, so this should even less controvertial.

* css/CSSValueKeywords.in:
Add new keywords.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionForRGBTypes):
(WebCore::CSSPropertyParserHelpers::parseColorFunctionForRGBTypes):
(WebCore::CSSPropertyParserHelpers::parseColorFunctionForXYZTypes):
(WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionForXYZTypes):
(WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionParameters):
(WebCore::CSSPropertyParserHelpers::parseNonRelativeColorFunctionParameters):
(WebCore::CSSPropertyParserHelpers::consumeColorMixColorSpaceAndComma):
(WebCore::CSSPropertyParserHelpers::mixColorComponents):
Add/update parsing support for new/updated colorspaces. parseColorFunctionForXYZTypes
is now templatized like parseColorFunctionForRGBTypes to allow reusing it for each
of the XYZ types.

* platform/graphics/ColorSpace.h:
(WebCore::callWithColorType):
* platform/graphics/ColorSpace.cpp:
(WebCore::operator<<):
* platform/graphics/ColorConversion.cpp:
(WebCore::converColorComponents):
Add new "named" colorspace, XYZ_D65, so that color(xyz-d65 ...) can be piped through
and serialized correctly. We already had a name for srgb-linear (though it was not
possible to create it from css previously) so no new name was needed for it.

* platform/graphics/ColorSerialization.cpp:
(WebCore::serialization):
(WebCore::serializationForCSS):
(WebCore::serializationForHTML):
(WebCore::serializationForRenderTreeAsText):
Add serialization specialization for xyz-d50/xyz-d65 and update name of LinearSRGBA
to "srgb-linear" to match the now defined name in css.

* platform/graphics/cg/ColorCG.cpp:
(WebCore::Color::createAndLosslesslyConvertToSupportedColorSpace):
* platform/graphics/cg/ColorSpaceCG.cpp:
(WebCore::xyzD50ColorSpaceRef):
(WebCore::colorSpaceForCGColorSpace):
(WebCore::xyzColorSpaceRef): Deleted.
* platform/graphics/cg/ColorSpaceCG.h:
(WebCore::cachedNullableCGColorSpace):
Updates xyzColorSpaceRef() function to be named xyzD50ColorSpaceRef() to more accurately
state what it is. It is not yet clear how or if an xyz-d65 colorspace can be created in
CoreGraphics, so we return nullptr when requested. This does not change any rendered values
as we can convert to extended-srgb in that case (as we do with lab and lch) without any loss.

LayoutTests:

Update tests for new srgb-linear, xyz-d50 and xyz-d65 colorspaces

* fast/css/parsing-color-function-expected.txt:
* fast/css/parsing-color-function.html:
* fast/css/parsing-color-mix-expected.txt:
* fast/css/parsing-color-mix.html:
* fast/css/parsing-relative-color-syntax-expected.txt:
* fast/css/parsing-relative-color-syntax.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcolorfunctionexpectedtxt">trunk/LayoutTests/fast/css/parsing-color-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcolorfunctionhtml">trunk/LayoutTests/fast/css/parsing-color-function.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcolormixexpectedtxt">trunk/LayoutTests/fast/css/parsing-color-mix-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcolormixhtml">trunk/LayoutTests/fast/css/parsing-color-mix.html</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingrelativecolorsyntaxexpectedtxt">trunk/LayoutTests/fast/css/parsing-relative-color-syntax-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingrelativecolorsyntaxhtml">trunk/LayoutTests/fast/css/parsing-relative-color-syntax.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorpredefined016html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/predefined-016.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz005html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-005.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelperscpp">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorConversioncpp">trunk/Source/WebCore/platform/graphics/ColorConversion.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorSerializationcpp">trunk/Source/WebCore/platform/graphics/ColorSerialization.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorSpacecpp">trunk/Source/WebCore/platform/graphics/ColorSpace.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorSpaceh">trunk/Source/WebCore/platform/graphics/ColorSpace.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorCGcpp">trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorSpaceCGcpp">trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorSpaceCGh">trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear001expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear001html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear002expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear002html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear003expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear003html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear004expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear004html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50001expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50001html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50002expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50002html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50003expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50003html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50004expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50004html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50005expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50005html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65001expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65001html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65002expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65002html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65003expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65003html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65004expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65004html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65005expectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65005html">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/ChangeLog 2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2021-11-25  Sam Weinig  <weinig@apple.com>
+
+        [CSS Color 4] Add support for new srgb-linear, xyz-d50 and xyz-d65 colorspaces
+        https://bugs.webkit.org/show_bug.cgi?id=233475
+
+        Reviewed by Dean Jackson.
+
+        Update tests for new srgb-linear, xyz-d50 and xyz-d65 colorspaces
+
+        * fast/css/parsing-color-function-expected.txt:
+        * fast/css/parsing-color-function.html:
+        * fast/css/parsing-color-mix-expected.txt:
+        * fast/css/parsing-color-mix.html:
+        * fast/css/parsing-relative-color-syntax-expected.txt:
+        * fast/css/parsing-relative-color-syntax.html:
+
</ins><span class="cx"> 2021-11-25  Enrique Ocaña González  <eocanha@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [GTK] Layout Test http/tests/media/video-play-waiting.html is timing out
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcolorfunctionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-color-function-expected.txt (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-color-function-expected.txt   2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/fast/css/parsing-color-function-expected.txt      2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -34,6 +34,36 @@
</span><span class="cx"> PASS computedStyle("background-color", "color(srgb 0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(srgb 40% 0 0deg)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> 
</span><ins>+Testing color(srgb-linear ...)
+PASS computedStyle("background-color", "color(srgb-linear 0% 0% 0%)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear 10% 10% 10%)") is "color(srgb-linear 0.1 0.1 0.1)"
+PASS computedStyle("background-color", "color(srgb-linear .2 .2 25%)") is "color(srgb-linear 0.2 0.2 0.25)"
+PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 1)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0% 0 0 / 0.5)") is "color(srgb-linear 0 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/0.5)") is "color(srgb-linear 0.2 0 1 / 0.5)"
+PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/50%)") is "color(srgb-linear 0.2 0 1 / 0.5)"
+PASS computedStyle("background-color", "color(srgb-linear 400% 0 10/50%)") is "color(srgb-linear 1 0 1 / 0.5)"
+PASS computedStyle("background-color", "color(srgb-linear 50% -160 160)") is "color(srgb-linear 0.5 0 1)"
+PASS computedStyle("background-color", "color(srgb-linear 50% -200 200)") is "color(srgb-linear 0.5 0 1)"
+PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / -10%)") is "color(srgb-linear 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 110%)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 300%)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear 50% -200)") is "color(srgb-linear 0.5 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear 50%)") is "color(srgb-linear 0.5 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(srgb-linear 50% -200 / 0.5)") is "color(srgb-linear 0.5 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(srgb-linear 50% / 0.5)") is "color(srgb-linear 0.5 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(srgb-linear / 0.5)") is "color(srgb-linear 0 0 0 / 0.5)"
+
+Test invalid values
+PASS computedStyle("background-color", "color(srgb-linear 0 0 0 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0deg 0% 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0% 0 0 1)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0% 0 0 10%)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0% 0 0deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(srgb-linear 0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(srgb-linear 40% 0 0deg)") is "rgba(0, 0, 0, 0)"
+
</ins><span class="cx"> Testing color(a98-rgb ...)
</span><span class="cx"> PASS computedStyle("background-color", "color(a98-rgb 0% 0% 0%)") is "color(a98-rgb 0 0 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(a98-rgb 10% 10% 10%)") is "color(a98-rgb 0.1 0.1 0.1)"
</span><span class="lines">@@ -125,26 +155,26 @@
</span><span class="cx"> PASS computedStyle("background-color", "color(prophoto-rgb 40% 0 0deg)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> 
</span><span class="cx"> Testing color(xyz ...)
</span><del>-PASS computedStyle("background-color", "color(xyz 0 0 0)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(xyz 0 0 0 / 1)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(xyz 1 1 1)") is "color(xyz 1 1 1)"
-PASS computedStyle("background-color", "color(xyz 1 1 1 / 1)") is "color(xyz 1 1 1)"
-PASS computedStyle("background-color", "color(xyz -1 -1 -1)") is "color(xyz -1 -1 -1)"
-PASS computedStyle("background-color", "color(xyz 0.1 0.1 0.1)") is "color(xyz 0.1 0.1 0.1)"
-PASS computedStyle("background-color", "color(xyz 10 10 10)") is "color(xyz 10 10 10)"
-PASS computedStyle("background-color", "color(xyz .2 .2 .25)") is "color(xyz 0.2 0.2 0.25)"
-PASS computedStyle("background-color", "color(xyz 0 0 0 / 0.5)") is "color(xyz 0 0 0 / 0.5)"
-PASS computedStyle("background-color", "color(xyz .20 0 10/0.5)") is "color(xyz 0.2 0 10 / 0.5)"
-PASS computedStyle("background-color", "color(xyz .20 0 10/50%)") is "color(xyz 0.2 0 10 / 0.5)"
-PASS computedStyle("background-color", "color(xyz 0 0 0 / -10%)") is "color(xyz 0 0 0 / 0)"
-PASS computedStyle("background-color", "color(xyz 0 0 0 / 110%)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(xyz 0 0 0 / 300%)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(xyz 1 1)") is "color(xyz 1 1 0)"
-PASS computedStyle("background-color", "color(xyz 1)") is "color(xyz 1 0 0)"
-PASS computedStyle("background-color", "color(xyz)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(xyz 1 1 / .5)") is "color(xyz 1 1 0 / 0.5)"
-PASS computedStyle("background-color", "color(xyz 1 / 0.5)") is "color(xyz 1 0 0 / 0.5)"
-PASS computedStyle("background-color", "color(xyz / 50%)") is "color(xyz 0 0 0 / 0.5)"
</del><ins>+PASS computedStyle("background-color", "color(xyz 0 0 0)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz 0 0 0 / 1)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz 1 1 1)") is "color(xyz-d65 1 1 1)"
+PASS computedStyle("background-color", "color(xyz 1 1 1 / 1)") is "color(xyz-d65 1 1 1)"
+PASS computedStyle("background-color", "color(xyz -1 -1 -1)") is "color(xyz-d65 -1 -1 -1)"
+PASS computedStyle("background-color", "color(xyz 0.1 0.1 0.1)") is "color(xyz-d65 0.1 0.1 0.1)"
+PASS computedStyle("background-color", "color(xyz 10 10 10)") is "color(xyz-d65 10 10 10)"
+PASS computedStyle("background-color", "color(xyz .2 .2 .25)") is "color(xyz-d65 0.2 0.2 0.25)"
+PASS computedStyle("background-color", "color(xyz 0 0 0 / 0.5)") is "color(xyz-d65 0 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz .20 0 10/0.5)") is "color(xyz-d65 0.2 0 10 / 0.5)"
+PASS computedStyle("background-color", "color(xyz .20 0 10/50%)") is "color(xyz-d65 0.2 0 10 / 0.5)"
+PASS computedStyle("background-color", "color(xyz 0 0 0 / -10%)") is "color(xyz-d65 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(xyz 0 0 0 / 110%)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz 0 0 0 / 300%)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz 1 1)") is "color(xyz-d65 1 1 0)"
+PASS computedStyle("background-color", "color(xyz 1)") is "color(xyz-d65 1 0 0)"
+PASS computedStyle("background-color", "color(xyz)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz 1 1 / .5)") is "color(xyz-d65 1 1 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz 1 / 0.5)") is "color(xyz-d65 1 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz / 50%)") is "color(xyz-d65 0 0 0 / 0.5)"
</ins><span class="cx"> 
</span><span class="cx"> Test invalid values
</span><span class="cx"> PASS computedStyle("background-color", "color(xyz 0 0 0 0)") is "rgba(0, 0, 0, 0)"
</span><span class="lines">@@ -155,6 +185,70 @@
</span><span class="cx"> PASS computedStyle("background-color", "color(xyz 0% 0 0deg)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(xyz 0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(xyz 40% 0 0deg)") is "rgba(0, 0, 0, 0)"
</span><ins>+
+Testing color(xyz-d50 ...)
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0 / 1)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d50 1 1 1)") is "color(xyz-d50 1 1 1)"
+PASS computedStyle("background-color", "color(xyz-d50 1 1 1 / 1)") is "color(xyz-d50 1 1 1)"
+PASS computedStyle("background-color", "color(xyz-d50 -1 -1 -1)") is "color(xyz-d50 -1 -1 -1)"
+PASS computedStyle("background-color", "color(xyz-d50 0.1 0.1 0.1)") is "color(xyz-d50 0.1 0.1 0.1)"
+PASS computedStyle("background-color", "color(xyz-d50 10 10 10)") is "color(xyz-d50 10 10 10)"
+PASS computedStyle("background-color", "color(xyz-d50 .2 .2 .25)") is "color(xyz-d50 0.2 0.2 0.25)"
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0 / 0.5)") is "color(xyz-d50 0 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d50 .20 0 10/0.5)") is "color(xyz-d50 0.2 0 10 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d50 .20 0 10/50%)") is "color(xyz-d50 0.2 0 10 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0 / -10%)") is "color(xyz-d50 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0 / 110%)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0 / 300%)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d50 1 1)") is "color(xyz-d50 1 1 0)"
+PASS computedStyle("background-color", "color(xyz-d50 1)") is "color(xyz-d50 1 0 0)"
+PASS computedStyle("background-color", "color(xyz-d50)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d50 1 1 / .5)") is "color(xyz-d50 1 1 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d50 1 / 0.5)") is "color(xyz-d50 1 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d50 / 50%)") is "color(xyz-d50 0 0 0 / 0.5)"
+
+Test invalid values
+PASS computedStyle("background-color", "color(xyz-d50 0 0 0 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0deg 0% 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0% 0 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0% 0 0 1)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0% 0 0 10%)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0% 0 0deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d50 40% 0 0deg)") is "rgba(0, 0, 0, 0)"
+
+Testing color(xyz-d65 ...)
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0 / 1)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d65 1 1 1)") is "color(xyz-d65 1 1 1)"
+PASS computedStyle("background-color", "color(xyz-d65 1 1 1 / 1)") is "color(xyz-d65 1 1 1)"
+PASS computedStyle("background-color", "color(xyz-d65 -1 -1 -1)") is "color(xyz-d65 -1 -1 -1)"
+PASS computedStyle("background-color", "color(xyz-d65 0.1 0.1 0.1)") is "color(xyz-d65 0.1 0.1 0.1)"
+PASS computedStyle("background-color", "color(xyz-d65 10 10 10)") is "color(xyz-d65 10 10 10)"
+PASS computedStyle("background-color", "color(xyz-d65 .2 .2 .25)") is "color(xyz-d65 0.2 0.2 0.25)"
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0 / 0.5)") is "color(xyz-d65 0 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d65 .20 0 10/0.5)") is "color(xyz-d65 0.2 0 10 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d65 .20 0 10/50%)") is "color(xyz-d65 0.2 0 10 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0 / -10%)") is "color(xyz-d65 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0 / 110%)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0 / 300%)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d65 1 1)") is "color(xyz-d65 1 1 0)"
+PASS computedStyle("background-color", "color(xyz-d65 1)") is "color(xyz-d65 1 0 0)"
+PASS computedStyle("background-color", "color(xyz-d65)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(xyz-d65 1 1 / .5)") is "color(xyz-d65 1 1 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d65 1 / 0.5)") is "color(xyz-d65 1 0 0 / 0.5)"
+PASS computedStyle("background-color", "color(xyz-d65 / 50%)") is "color(xyz-d65 0 0 0 / 0.5)"
+
+Test invalid values
+PASS computedStyle("background-color", "color(xyz-d65 0 0 0 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0deg 0% 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0% 0 0)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0% 0 0 1)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0% 0 0 10%)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0% 0 0deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(xyz-d65 40% 0 0deg)") is "rgba(0, 0, 0, 0)"
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcolorfunctionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-color-function.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-color-function.html   2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/fast/css/parsing-color-function.html      2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">         shouldBeEqualToString('innerStyle("' + property + '", "' + value + '")', expected);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (const color of [ "srgb", "a98-rgb", "rec2020", "prophoto-rgb" ]) {
</del><ins>+    for (const color of [ "srgb", "srgb-linear", "a98-rgb", "rec2020", "prophoto-rgb" ]) {
</ins><span class="cx">         debug('');
</span><span class="cx">         debug(`Testing color(${color} ...)`);
</span><span class="cx">         
</span><span class="lines">@@ -69,40 +69,44 @@
</span><span class="cx">         testComputed("background-color", `color(${color} 40% 0 0deg)`, `rgba(0, 0, 0, 0)`);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    debug('');
-    debug(`Testing color(xyz ...)`);
-    
-    testComputed("background-color", `color(xyz 0 0 0)`, `color(xyz 0 0 0)`);
-    testComputed("background-color", `color(xyz 0 0 0 / 1)`, `color(xyz 0 0 0)`);
-    testComputed("background-color", `color(xyz 1 1 1)`, `color(xyz 1 1 1)`);
-    testComputed("background-color", `color(xyz 1 1 1 / 1)`, `color(xyz 1 1 1)`);
-    testComputed("background-color", `color(xyz -1 -1 -1)`, `color(xyz -1 -1 -1)`);
-    testComputed("background-color", `color(xyz 0.1 0.1 0.1)`, `color(xyz 0.1 0.1 0.1)`);
-    testComputed("background-color", `color(xyz 10 10 10)`, `color(xyz 10 10 10)`);
-    testComputed("background-color", `color(xyz .2 .2 .25)`, `color(xyz 0.2 0.2 0.25)`);
-    testComputed("background-color", `color(xyz 0 0 0 / 0.5)`, `color(xyz 0 0 0 / 0.5)`);
-    testComputed("background-color", `color(xyz .20 0 10/0.5)`, `color(xyz 0.2 0 10 / 0.5)`);
-    testComputed("background-color", `color(xyz .20 0 10/50%)`, `color(xyz 0.2 0 10 / 0.5)`);
-    testComputed("background-color", `color(xyz 0 0 0 / -10%)`, `color(xyz 0 0 0 / 0)`);
-    testComputed("background-color", `color(xyz 0 0 0 / 110%)`, `color(xyz 0 0 0)`);
-    testComputed("background-color", `color(xyz 0 0 0 / 300%)`, `color(xyz 0 0 0)`);
-    testComputed("background-color", `color(xyz 1 1)`, `color(xyz 1 1 0)`);
-    testComputed("background-color", `color(xyz 1)`, `color(xyz 1 0 0)`);
-    testComputed("background-color", `color(xyz)`, `color(xyz 0 0 0)`);
-    testComputed("background-color", `color(xyz 1 1 / .5)`, `color(xyz 1 1 0 / 0.5)`);
-    testComputed("background-color", `color(xyz 1 / 0.5)`, `color(xyz 1 0 0 / 0.5)`);
-    testComputed("background-color", `color(xyz / 50%)`, `color(xyz 0 0 0 / 0.5)`);
</del><ins>+    for (const color of [ "xyz", "xyz-d50", "xyz-d65" ]) {
+        debug('');
+        debug(`Testing color(${color} ...)`);
+  
+               const resultColorSpace = color == "xyz" ? "xyz-d65" : color; 
+  
+           testComputed("background-color", `color(${color} 0 0 0)`, `color(${resultColorSpace} 0 0 0)`);
+           testComputed("background-color", `color(${color} 0 0 0 / 1)`, `color(${resultColorSpace} 0 0 0)`);
+           testComputed("background-color", `color(${color} 1 1 1)`, `color(${resultColorSpace} 1 1 1)`);
+           testComputed("background-color", `color(${color} 1 1 1 / 1)`, `color(${resultColorSpace} 1 1 1)`);
+           testComputed("background-color", `color(${color} -1 -1 -1)`, `color(${resultColorSpace} -1 -1 -1)`);
+           testComputed("background-color", `color(${color} 0.1 0.1 0.1)`, `color(${resultColorSpace} 0.1 0.1 0.1)`);
+           testComputed("background-color", `color(${color} 10 10 10)`, `color(${resultColorSpace} 10 10 10)`);
+           testComputed("background-color", `color(${color} .2 .2 .25)`, `color(${resultColorSpace} 0.2 0.2 0.25)`);
+           testComputed("background-color", `color(${color} 0 0 0 / 0.5)`, `color(${resultColorSpace} 0 0 0 / 0.5)`);
+           testComputed("background-color", `color(${color} .20 0 10/0.5)`, `color(${resultColorSpace} 0.2 0 10 / 0.5)`);
+           testComputed("background-color", `color(${color} .20 0 10/50%)`, `color(${resultColorSpace} 0.2 0 10 / 0.5)`);
+           testComputed("background-color", `color(${color} 0 0 0 / -10%)`, `color(${resultColorSpace} 0 0 0 / 0)`);
+           testComputed("background-color", `color(${color} 0 0 0 / 110%)`, `color(${resultColorSpace} 0 0 0)`);
+           testComputed("background-color", `color(${color} 0 0 0 / 300%)`, `color(${resultColorSpace} 0 0 0)`);
+           testComputed("background-color", `color(${color} 1 1)`, `color(${resultColorSpace} 1 1 0)`);
+           testComputed("background-color", `color(${color} 1)`, `color(${resultColorSpace} 1 0 0)`);
+           testComputed("background-color", `color(${color})`, `color(${resultColorSpace} 0 0 0)`);
+           testComputed("background-color", `color(${color} 1 1 / .5)`, `color(${resultColorSpace} 1 1 0 / 0.5)`);
+           testComputed("background-color", `color(${color} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`);
+           testComputed("background-color", `color(${color} / 50%)`, `color(${resultColorSpace} 0 0 0 / 0.5)`);
</ins><span class="cx"> 
</span><del>-    debug('');
-    debug('Test invalid values');
-    testComputed("background-color", `color(xyz 0 0 0 0)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 0deg 0% 0)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 0% 0 0)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 0% 0 0 1)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 0% 0 0 10%)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 0% 0 0deg)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 0% 0% 0deg)`, `rgba(0, 0, 0, 0)`);
-    testComputed("background-color", `color(xyz 40% 0 0deg)`, `rgba(0, 0, 0, 0)`);
</del><ins>+            debug('');
+           debug('Test invalid values');
+           testComputed("background-color", `color(${color} 0 0 0 0)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 0deg 0% 0)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 0% 0 0)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 0% 0 0 1)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 0% 0 0 10%)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 0% 0 0deg)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 0% 0% 0deg)`, `rgba(0, 0, 0, 0)`);
+           testComputed("background-color", `color(${color} 40% 0 0deg)`, `rgba(0, 0, 0, 0)`);
+       }
</ins><span class="cx"> 
</span><span class="cx"> </script>
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcolormixexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-color-mix-expected.txt (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-color-mix-expected.txt        2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/fast/css/parsing-color-mix-expected.txt   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-color-mix(hsl, ...)
</del><ins>+color-mix(in hsl, ...)
</ins><span class="cx"> PASS computedStyle("background-color", "color-mix(in hsl, hsl(120deg 10% 20%), hsl(30deg 30% 40%))") is "rgb(84, 92, 61)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hsl, hsl(120deg 10% 20%) 25%, hsl(30deg 30% 40%))") is "rgb(112, 106, 67)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hsl, 25% hsl(120deg 10% 20%), hsl(30deg 30% 40%))") is "rgb(112, 106, 67)"
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hsl, hsl(120deg 10% 20%) 0%, hsl(30deg 30% 40%))") is "rgb(133, 102, 71)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hsl, hsl(120deg 10% 20%) -10%, hsl(30deg 30% 40%))") is "rgb(142, 97, 72)"
</span><span class="cx"> 
</span><del>-color-mix(hwb, ...)
</del><ins>+color-mix(in hwb, ...)
</ins><span class="cx"> PASS computedStyle("background-color", "color-mix(in hwb, hwb(120deg 10% 20%), hwb(30deg 30% 40%))") is "rgb(147, 179, 52)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hwb, hwb(120deg 10% 20%) 25%, hwb(30deg 30% 40%))") is "rgb(166, 153, 64)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hwb, 25% hwb(120deg 10% 20%), hwb(30deg 30% 40%))") is "rgb(166, 153, 64)"
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hwb, hwb(120deg 10% 20%) 0%, hwb(30deg 30% 40%))") is "rgb(153, 115, 77)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in hwb, hwb(120deg 10% 20%) -10%, hwb(30deg 30% 40%))") is "rgb(148, 105, 82)"
</span><span class="cx"> 
</span><del>-color-mix(lch, ...)
</del><ins>+color-mix(in lch, ...)
</ins><span class="cx"> PASS computedStyle("background-color", "color-mix(in lch, lch(10% 20 30deg / .4), lch(50% 60 70deg / .8))") is "lch(30% 40 50 / 0.6)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lch, lch(10% 20 30deg / .4) 25%, lch(50% 60 70deg / .8))") is "lch(40% 50 60 / 0.7)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lch, 25% lch(10% 20 30deg / .4), lch(50% 60 70deg / .8))") is "lch(40% 50 60 / 0.7)"
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lch, lch(10% 20 30deg / .4) 0%, lch(50% 60 70deg / .8))") is "lch(50% 60 70 / 0.8)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lch, lch(10% 20 30deg / .4) -10%, lch(50% 60 70deg / .8))") is "lch(54% 64 74 / 0.84000003)"
</span><span class="cx"> 
</span><del>-color-mix(lab, ...)
</del><ins>+color-mix(in lab, ...)
</ins><span class="cx"> PASS computedStyle("background-color", "color-mix(in lab, lab(10% 20 30 / .4), lab(50% 60 70 / .8))") is "lab(30% 40 50 / 0.6)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lab, lab(10% 20 30 / .4) 25%, lab(50% 60 70 / .8))") is "lab(40% 50 60 / 0.7)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lab, 25% lab(10% 20 30 / .4), lab(50% 60 70 / .8))") is "lab(40% 50 60 / 0.7)"
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lab, lab(10% 20 30 / .4) 0%, lab(50% 60 70 / .8))") is "lab(50% 60 70 / 0.8)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in lab, lab(10% 20 30 / .4) -10%, lab(50% 60 70 / .8))") is "lab(54% 64 74 / 0.84000003)"
</span><span class="cx"> 
</span><del>-color-mix(srgb, ...)
</del><ins>+color-mix(in srgb, ...)
</ins><span class="cx"> PASS computedStyle("background-color", "color-mix(in srgb, color(srgb .1 .2 .3 / .4), color(srgb .5 .6 .7 / .8))") is "color(srgb 0.3 0.4 0.5 / 0.6)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in srgb, color(srgb .1 .2 .3 / .4) 25%, color(srgb .5 .6 .7 / .8))") is "color(srgb 0.4 0.5 0.6 / 0.7)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in srgb, 25% color(srgb .1 .2 .3 / .4), color(srgb .5 .6 .7 / .8))") is "color(srgb 0.4 0.5 0.6 / 0.7)"
</span><span class="lines">@@ -63,17 +63,41 @@
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in srgb, color(srgb .1 .2 .3 / .4) 0%, color(srgb .5 .6 .7 / .8))") is "color(srgb 0.5 0.6 0.7 / 0.8)"
</span><span class="cx"> PASS computedStyle("background-color", "color-mix(in srgb, color(srgb .1 .2 .3 / .4) -10%, color(srgb .5 .6 .7 / .8))") is "color(srgb 0.54 0.64000005 0.74 / 0.84000003)"
</span><span class="cx"> 
</span><del>-color-mix(xyz, ...)
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8))") is "color(xyz 0.3 0.4 0.5 / 0.6)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8))") is "color(xyz 0.4 0.5 0.6 / 0.7)"
-PASS computedStyle("background-color", "color-mix(in xyz, 25% color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8))") is "color(xyz 0.4 0.5 0.6 / 0.7)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8) 25%)") is "color(xyz 0.2 0.3 0.4 / 0.5)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4), 25% color(xyz .5 .6 .7 / .8))") is "color(xyz 0.2 0.3 0.4 / 0.5)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8) 75%)") is "color(xyz 0.4 0.5 0.6 / 0.7)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 50%, color(xyz .5 .6 .7 / .8) 150%)") is "color(xyz 0.4 0.5 0.6 / 0.7)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 12.5%, color(xyz .5 .6 .7 / .8) 37.5%)") is "color(xyz 0.4 0.5 0.6 / 0.7)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 0%, color(xyz .5 .6 .7 / .8))") is "color(xyz 0.5 0.6 0.7 / 0.8)"
-PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) -10%, color(xyz .5 .6 .7 / .8))") is "color(xyz 0.54 0.64000005 0.74 / 0.84000003)"
</del><ins>+color-mix(in xyz, ...)
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8))") is "color(xyz-d65 0.3 0.4 0.5 / 0.6)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8))") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz, 25% color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8))") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8) 25%)") is "color(xyz-d65 0.2 0.3 0.4 / 0.5)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4), 25% color(xyz .5 .6 .7 / .8))") is "color(xyz-d65 0.2 0.3 0.4 / 0.5)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8) 75%)") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 50%, color(xyz .5 .6 .7 / .8) 150%)") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 12.5%, color(xyz .5 .6 .7 / .8) 37.5%)") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 0%, color(xyz .5 .6 .7 / .8))") is "color(xyz-d65 0.5 0.6 0.7 / 0.8)"
+PASS computedStyle("background-color", "color-mix(in xyz, color(xyz .1 .2 .3 / .4) -10%, color(xyz .5 .6 .7 / .8))") is "color(xyz-d65 0.54 0.64000005 0.74 / 0.84000003)"
+
+color-mix(in xyz-d50, ...)
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4), color(xyz-d50 .5 .6 .7 / .8))") is "color(xyz-d50 0.3 0.4 0.5 / 0.6)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 25%, color(xyz-d50 .5 .6 .7 / .8))") is "color(xyz-d50 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, 25% color(xyz-d50 .1 .2 .3 / .4), color(xyz-d50 .5 .6 .7 / .8))") is "color(xyz-d50 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4), color(xyz-d50 .5 .6 .7 / .8) 25%)") is "color(xyz-d50 0.2 0.3 0.4 / 0.5)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4), 25% color(xyz-d50 .5 .6 .7 / .8))") is "color(xyz-d50 0.2 0.3 0.4 / 0.5)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 25%, color(xyz-d50 .5 .6 .7 / .8) 75%)") is "color(xyz-d50 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 50%, color(xyz-d50 .5 .6 .7 / .8) 150%)") is "color(xyz-d50 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 12.5%, color(xyz-d50 .5 .6 .7 / .8) 37.5%)") is "color(xyz-d50 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 0%, color(xyz-d50 .5 .6 .7 / .8))") is "color(xyz-d50 0.5 0.6 0.7 / 0.8)"
+PASS computedStyle("background-color", "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) -10%, color(xyz-d50 .5 .6 .7 / .8))") is "color(xyz-d50 0.54 0.64000005 0.74 / 0.84000003)"
+
+color-mix(in xyz-d65, ...)
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4), color(xyz-d65 .5 .6 .7 / .8))") is "color(xyz-d65 0.3 0.4 0.5 / 0.6)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 25%, color(xyz-d65 .5 .6 .7 / .8))") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, 25% color(xyz-d65 .1 .2 .3 / .4), color(xyz-d65 .5 .6 .7 / .8))") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4), color(xyz-d65 .5 .6 .7 / .8) 25%)") is "color(xyz-d65 0.2 0.3 0.4 / 0.5)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4), 25% color(xyz-d65 .5 .6 .7 / .8))") is "color(xyz-d65 0.2 0.3 0.4 / 0.5)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 25%, color(xyz-d65 .5 .6 .7 / .8) 75%)") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 50%, color(xyz-d65 .5 .6 .7 / .8) 150%)") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 12.5%, color(xyz-d65 .5 .6 .7 / .8) 37.5%)") is "color(xyz-d65 0.4 0.5 0.6 / 0.7)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 0%, color(xyz-d65 .5 .6 .7 / .8))") is "color(xyz-d65 0.5 0.6 0.7 / 0.8)"
+PASS computedStyle("background-color", "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) -10%, color(xyz-d65 .5 .6 .7 / .8))") is "color(xyz-d65 0.54 0.64000005 0.74 / 0.84000003)"
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcolormixhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-color-mix.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-color-mix.html        2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/fast/css/parsing-color-mix.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx">         testComputedProperty("background-color", value, expected);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    debug('color-mix(hsl, ...)');
</del><ins>+    debug('color-mix(in hsl, ...)');
</ins><span class="cx"> 
</span><span class="cx">     testComputed(`color-mix(in hsl, hsl(120deg 10% 20%), hsl(30deg 30% 40%))`, `rgb(84, 92, 61)`); // hsl(75deg 20% 30%)
</span><span class="cx">     testComputed(`color-mix(in hsl, hsl(120deg 10% 20%) 25%, hsl(30deg 30% 40%))`, `rgb(112, 106, 67)`);
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     debug('');
</span><del>-    debug('color-mix(hwb, ...)');
</del><ins>+    debug('color-mix(in hwb, ...)');
</ins><span class="cx"> 
</span><span class="cx">     testComputed(`color-mix(in hwb, hwb(120deg 10% 20%), hwb(30deg 30% 40%))`, `rgb(147, 179, 52)`); // hwb(75deg 20% 30%)
</span><span class="cx">     testComputed(`color-mix(in hwb, hwb(120deg 10% 20%) 25%, hwb(30deg 30% 40%))`, `rgb(166, 153, 64)`);
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     
</span><span class="cx"> 
</span><span class="cx">     debug('');
</span><del>-    debug('color-mix(lch, ...)');
</del><ins>+    debug('color-mix(in lch, ...)');
</ins><span class="cx"> 
</span><span class="cx">     testComputed(`color-mix(in lch, lch(10% 20 30deg / .4), lch(50% 60 70deg / .8))`, `lch(30% 40 50 / 0.6)`);
</span><span class="cx">     testComputed(`color-mix(in lch, lch(10% 20 30deg / .4) 25%, lch(50% 60 70deg / .8))`, `lch(40% 50 60 / 0.7)`);
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     debug('');
</span><del>-    debug('color-mix(lab, ...)');
</del><ins>+    debug('color-mix(in lab, ...)');
</ins><span class="cx"> 
</span><span class="cx">     testComputed(`color-mix(in lab, lab(10% 20 30 / .4), lab(50% 60 70 / .8))`, `lab(30% 40 50 / 0.6)`);
</span><span class="cx">     testComputed(`color-mix(in lab, lab(10% 20 30 / .4) 25%, lab(50% 60 70 / .8))`, `lab(40% 50 60 / 0.7)`);
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     testComputed(`color-mix(in lab, lab(10% 20 30 / .4) -10%, lab(50% 60 70 / .8))`, `lab(54% 64 74 / 0.84000003)`);
</span><span class="cx">  
</span><span class="cx">     debug('');
</span><del>-    debug('color-mix(srgb, ...)');
</del><ins>+    debug('color-mix(in srgb, ...)');
</ins><span class="cx"> 
</span><span class="cx">     testComputed(`color-mix(in srgb, color(srgb .1 .2 .3 / .4), color(srgb .5 .6 .7 / .8))`, `color(srgb 0.3 0.4 0.5 / 0.6)`);
</span><span class="cx">     testComputed(`color-mix(in srgb, color(srgb .1 .2 .3 / .4) 25%, color(srgb .5 .6 .7 / .8))`, `color(srgb 0.4 0.5 0.6 / 0.7)`);
</span><span class="lines">@@ -108,22 +108,25 @@
</span><span class="cx">     // What should happen if you provide a negative percent? https://github.com/w3c/csswg-drafts/issues/6047
</span><span class="cx">     testComputed(`color-mix(in srgb, color(srgb .1 .2 .3 / .4) -10%, color(srgb .5 .6 .7 / .8))`, `color(srgb 0.54 0.64000005 0.74 / 0.84000003)`);
</span><span class="cx"> 
</span><ins>+    for (const colorSpace of [ "xyz", "xyz-d50", "xyz-d65" ]) {
+        debug('');
+        debug(`color-mix(in ${colorSpace}, ...)`);
+  
+               const resultColorSpace = colorSpace == "xyz" ? "xyz-d65" : colorSpace; 
</ins><span class="cx"> 
</span><del>-    debug('');
-    debug('color-mix(xyz, ...)');
</del><ins>+            testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4), color(${colorSpace} .5 .6 .7 / .8))`, `color(${resultColorSpace} 0.3 0.4 0.5 / 0.6)`);
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 25%, color(${colorSpace} .5 .6 .7 / .8))`, `color(${resultColorSpace} 0.4 0.5 0.6 / 0.7)`);
+           testComputed(`color-mix(in ${colorSpace}, 25% color(${colorSpace} .1 .2 .3 / .4), color(${colorSpace} .5 .6 .7 / .8))`, `color(${resultColorSpace} 0.4 0.5 0.6 / 0.7)`);
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4), color(${colorSpace} .5 .6 .7 / .8) 25%)`, `color(${resultColorSpace} 0.2 0.3 0.4 / 0.5)`);
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4), 25% color(${colorSpace} .5 .6 .7 / .8))`, `color(${resultColorSpace} 0.2 0.3 0.4 / 0.5)`);
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 25%, color(${colorSpace} .5 .6 .7 / .8) 75%)`, `color(${resultColorSpace} 0.4 0.5 0.6 / 0.7)`);
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 50%, color(${colorSpace} .5 .6 .7 / .8) 150%)`, `color(${resultColorSpace} 0.4 0.5 0.6 / 0.7)`); // Scale down > 100% sum.
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 12.5%, color(${colorSpace} .5 .6 .7 / .8) 37.5%)`, `color(${resultColorSpace} 0.4 0.5 0.6 / 0.7)`); // Scale up < 100% sum.
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 0%, color(${colorSpace} .5 .6 .7 / .8))`, `color(${resultColorSpace} 0.5 0.6 0.7 / 0.8)`);
</ins><span class="cx"> 
</span><del>-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8))`, `color(xyz 0.3 0.4 0.5 / 0.6)`);
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8))`, `color(xyz 0.4 0.5 0.6 / 0.7)`);
-    testComputed(`color-mix(in xyz, 25% color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8))`, `color(xyz 0.4 0.5 0.6 / 0.7)`);
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4), color(xyz .5 .6 .7 / .8) 25%)`, `color(xyz 0.2 0.3 0.4 / 0.5)`);
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4), 25% color(xyz .5 .6 .7 / .8))`, `color(xyz 0.2 0.3 0.4 / 0.5)`);
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4) 25%, color(xyz .5 .6 .7 / .8) 75%)`, `color(xyz 0.4 0.5 0.6 / 0.7)`);
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4) 50%, color(xyz .5 .6 .7 / .8) 150%)`, `color(xyz 0.4 0.5 0.6 / 0.7)`); // Scale down > 100% sum.
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4) 12.5%, color(xyz .5 .6 .7 / .8) 37.5%)`, `color(xyz 0.4 0.5 0.6 / 0.7)`); // Scale up < 100% sum.
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4) 0%, color(xyz .5 .6 .7 / .8))`, `color(xyz 0.5 0.6 0.7 / 0.8)`);
-
-    // What should happen if you provide a negative percent? https://github.com/w3c/csswg-drafts/issues/6047
-    testComputed(`color-mix(in xyz, color(xyz .1 .2 .3 / .4) -10%, color(xyz .5 .6 .7 / .8))`, `color(xyz 0.54 0.64000005 0.74 / 0.84000003)`);
</del><ins>+            // What should happen if you provide a negative percent? https://github.com/w3c/csswg-drafts/issues/6047
+           testComputed(`color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) -10%, color(${colorSpace} .5 .6 .7 / .8))`, `color(${resultColorSpace} 0.54 0.64000005 0.74 / 0.84000003)`);
+       }
</ins><span class="cx"> </script>
</span><span class="cx">     
</span><span class="cx"> <script src="../../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingrelativecolorsyntaxexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-relative-color-syntax-expected.txt (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-relative-color-syntax-expected.txt    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/fast/css/parsing-relative-color-syntax-expected.txt       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -339,6 +339,58 @@
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(srgb 0.7 0.5 0.3) srgb l g b)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> 
</span><span class="cx"> color(from ... ${color} ...)
</span><ins>+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b)") is "color(srgb-linear 0.7 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b / alpha)") is "color(srgb-linear 0.7 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b)") is "color(srgb-linear 0.7 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / alpha)") is "color(srgb-linear 0.7 0.5 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b) srgb-linear r g b)") is "color(srgb-linear 0.7 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 0 0 0)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 0 0 0)") is "color(srgb-linear 0 0 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 0 0 0 / 0)") is "color(srgb-linear 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 0 0 0 / 0)") is "color(srgb-linear 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 0 g b / alpha)") is "color(srgb-linear 0 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r 0 b / alpha)") is "color(srgb-linear 0.7 0 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g 0 / alpha)") is "color(srgb-linear 0.7 0.5 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b / 0)") is "color(srgb-linear 0.7 0.5 0.3 / 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear 0 g b / alpha)") is "color(srgb-linear 0 0.5 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r 0 b / alpha)") is "color(srgb-linear 0.7 0 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g 0 / alpha)") is "color(srgb-linear 0.7 0.5 0 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 0)") is "color(srgb-linear 0.7 0.5 0.3 / 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 0.2 g b / alpha)") is "color(srgb-linear 0.2 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 20% g b / alpha)") is "color(srgb-linear 0.2 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r 0.2 b / alpha)") is "color(srgb-linear 0.7 0.2 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r 20% b / alpha)") is "color(srgb-linear 0.7 0.2 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g 0.2 / alpha)") is "color(srgb-linear 0.7 0.5 0.2)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g 20% / alpha)") is "color(srgb-linear 0.7 0.5 0.2)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b / 0.2)") is "color(srgb-linear 0.7 0.5 0.3 / 0.2)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b / 20%)") is "color(srgb-linear 0.7 0.5 0.3 / 0.2)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear 0.2 g b / alpha)") is "color(srgb-linear 0.2 0.5 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear 20% g b / alpha)") is "color(srgb-linear 0.2 0.5 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r 0.2 b / alpha)") is "color(srgb-linear 0.7 0.2 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r 20% b / alpha)") is "color(srgb-linear 0.7 0.2 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g 0.2 / alpha)") is "color(srgb-linear 0.7 0.5 0.2 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g 20% / alpha)") is "color(srgb-linear 0.7 0.5 0.2 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 0.2)") is "color(srgb-linear 0.7 0.5 0.3 / 0.2)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 20%)") is "color(srgb-linear 0.7 0.5 0.3 / 0.2)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear g b r)") is "color(srgb-linear 0.5 0.3 0.7)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear b alpha r / g)") is "color(srgb-linear 0.3 1 0.7 / 0.5)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r r r / r)") is "color(srgb-linear 0.7 0.7 0.7 / 0.7)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear alpha alpha alpha / alpha)") is "color(srgb-linear 1 1 1)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear g b r)") is "color(srgb-linear 0.5 0.3 0.7)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear b alpha r / g)") is "color(srgb-linear 0.3 0.4 0.7 / 0.5)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r r r / r)") is "color(srgb-linear 0.7 0.7 0.7 / 0.7)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear alpha alpha alpha / alpha)") is "color(srgb-linear 0.4 0.4 0.4 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear calc(r) calc(g) calc(b))") is "color(srgb-linear 0.7 0.5 0.3)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear calc(r) calc(g) calc(b) / calc(alpha))") is "color(srgb-linear 0.7 0.5 0.3 / 0.4)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 10deg g b)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r 10deg b)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g 10deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear r g b / 10deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear red g b)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear x g b)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear l g b)") is "rgba(0, 0, 0, 0)"
+
+color(from ... ${color} ...)
</ins><span class="cx"> PASS computedStyle("background-color", "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb r g b)") is "color(a98-rgb 0.7 0.5 0.3)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb r g b / alpha)") is "color(a98-rgb 0.7 0.5 0.3)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b)") is "color(a98-rgb 0.7 0.5 0.3)"
</span><span class="lines">@@ -495,42 +547,42 @@
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb l g b)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> 
</span><span class="cx"> color(from ... xyz ...)
</span><del>-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z)") is "color(xyz 7 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / alpha)") is "color(xyz 7 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z)") is "color(xyz 7 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / alpha)") is "color(xyz 7 -20.5 100 / 0.4)"
-PASS computedStyle("background-color", "color(from color(from color(xyz 7 -20.5 100) xyz x y z) xyz x y z)") is "color(xyz 7 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0)") is "color(xyz 0 0 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0 / 0)") is "color(xyz 0 0 0 / 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0 / 0)") is "color(xyz 0 0 0 / 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 y z / alpha)") is "color(xyz 0 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x 0 z / alpha)") is "color(xyz 7 0 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y 0 / alpha)") is "color(xyz 7 -20.5 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / 0)") is "color(xyz 7 -20.5 100 / 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz 0 y z / alpha)") is "color(xyz 0 -20.5 100 / 0.4)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x 0 z / alpha)") is "color(xyz 7 0 100 / 0.4)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y 0 / alpha)") is "color(xyz 7 -20.5 0 / 0.4)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / 0)") is "color(xyz 7 -20.5 100 / 0)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0.2 y z / alpha)") is "color(xyz 0.2 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x 0.2 z / alpha)") is "color(xyz 7 0.2 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y 0.2 / alpha)") is "color(xyz 7 -20.5 0.2)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / 0.2)") is "color(xyz 7 -20.5 100 / 0.2)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / 20%)") is "color(xyz 7 -20.5 100 / 0.2)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz 0.2 y z / alpha)") is "color(xyz 0.2 -20.5 100 / 0.4)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x 0.2 z / alpha)") is "color(xyz 7 0.2 100 / 0.4)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y 0.2 / alpha)") is "color(xyz 7 -20.5 0.2 / 0.4)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / 0.2)") is "color(xyz 7 -20.5 100 / 0.2)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz y z x)") is "color(xyz -20.5 100 7)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x x x / x)") is "color(xyz 7 7 7)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz y z x)") is "color(xyz -20.5 100 7)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x x x / x)") is "color(xyz 7 7 7)"
</del><ins>+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / alpha)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / alpha)") is "color(xyz-d65 7 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(from color(xyz 7 -20.5 100) xyz x y z) xyz x y z)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0 / 0)") is "color(xyz-d65 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 0 0 / 0)") is "color(xyz-d65 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0 y z / alpha)") is "color(xyz-d65 0 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x 0 z / alpha)") is "color(xyz-d65 7 0 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y 0 / alpha)") is "color(xyz-d65 7 -20.5 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / 0)") is "color(xyz-d65 7 -20.5 100 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz 0 y z / alpha)") is "color(xyz-d65 0 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x 0 z / alpha)") is "color(xyz-d65 7 0 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y 0 / alpha)") is "color(xyz-d65 7 -20.5 0 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / 0)") is "color(xyz-d65 7 -20.5 100 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 0.2 y z / alpha)") is "color(xyz-d65 0.2 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x 0.2 z / alpha)") is "color(xyz-d65 7 0.2 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y 0.2 / alpha)") is "color(xyz-d65 7 -20.5 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / 0.2)") is "color(xyz-d65 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y z / 20%)") is "color(xyz-d65 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz 0.2 y z / alpha)") is "color(xyz-d65 0.2 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x 0.2 z / alpha)") is "color(xyz-d65 7 0.2 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y 0.2 / alpha)") is "color(xyz-d65 7 -20.5 0.2 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / 0.2)") is "color(xyz-d65 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz y z x)") is "color(xyz-d65 -20.5 100 7)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x x x / x)") is "color(xyz-d65 7 7 7)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz y z x)") is "color(xyz-d65 -20.5 100 7)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz x x x / x)") is "color(xyz-d65 7 7 7)"
</ins><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz z alpha x / y)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz alpha alpha alpha / alpha)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz z alpha x / y)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz alpha alpha alpha / alpha)") is "rgba(0, 0, 0, 0)"
</span><del>-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz calc(x) calc(y) calc(z))") is "color(xyz 7 -20.5 100)"
-PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz calc(x) calc(y) calc(z) / calc(alpha))") is "color(xyz 7 -20.5 100 / 0.4)"
</del><ins>+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz calc(x) calc(y) calc(z))") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100 / 40%) xyz calc(x) calc(y) calc(z) / calc(alpha))") is "color(xyz-d65 7 -20.5 100 / 0.4)"
</ins><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz 10deg y z)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x 10deg z)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz x y 10deg)") is "rgba(0, 0, 0, 0)"
</span><span class="lines">@@ -539,6 +591,96 @@
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz r y z)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> PASS computedStyle("background-color", "color(from color(xyz 7 -20.5 100) xyz l y z)") is "rgba(0, 0, 0, 0)"
</span><span class="cx"> 
</span><ins>+color(from ... xyz-d50 ...)
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z)") is "color(xyz-d50 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z / alpha)") is "color(xyz-d50 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x y z)") is "color(xyz-d50 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x y z / alpha)") is "color(xyz-d50 7 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z) xyz-d50 x y z)") is "color(xyz-d50 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 0 0 0)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 0 0 0)") is "color(xyz-d50 0 0 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 0 0 0 / 0)") is "color(xyz-d50 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 0 0 0 / 0)") is "color(xyz-d50 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 0 y z / alpha)") is "color(xyz-d50 0 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x 0 z / alpha)") is "color(xyz-d50 7 0 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y 0 / alpha)") is "color(xyz-d50 7 -20.5 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z / 0)") is "color(xyz-d50 7 -20.5 100 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 0 y z / alpha)") is "color(xyz-d50 0 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x 0 z / alpha)") is "color(xyz-d50 7 0 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x y 0 / alpha)") is "color(xyz-d50 7 -20.5 0 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x y z / 0)") is "color(xyz-d50 7 -20.5 100 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 0.2 y z / alpha)") is "color(xyz-d50 0.2 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x 0.2 z / alpha)") is "color(xyz-d50 7 0.2 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y 0.2 / alpha)") is "color(xyz-d50 7 -20.5 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z / 0.2)") is "color(xyz-d50 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z / 20%)") is "color(xyz-d50 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 0.2 y z / alpha)") is "color(xyz-d50 0.2 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x 0.2 z / alpha)") is "color(xyz-d50 7 0.2 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x y 0.2 / alpha)") is "color(xyz-d50 7 -20.5 0.2 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x y z / 0.2)") is "color(xyz-d50 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 y z x)") is "color(xyz-d50 -20.5 100 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x x x / x)") is "color(xyz-d50 7 7 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 y z x)") is "color(xyz-d50 -20.5 100 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 x x x / x)") is "color(xyz-d50 7 7 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 z alpha x / y)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 alpha alpha alpha / alpha)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 z alpha x / y)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 alpha alpha alpha / alpha)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 calc(x) calc(y) calc(z))") is "color(xyz-d50 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100 / 40%) xyz-d50 calc(x) calc(y) calc(z) / calc(alpha))") is "color(xyz-d50 7 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 10deg y z)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x 10deg z)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y 10deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 x y z / 10deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 red y)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 r y z)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d50 7 -20.5 100) xyz-d50 l y z)") is "rgba(0, 0, 0, 0)"
+
+color(from ... xyz-d65 ...)
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z / alpha)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x y z)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x y z / alpha)") is "color(xyz-d65 7 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z) xyz-d65 x y z)") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 0 0 0)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 0 0 0)") is "color(xyz-d65 0 0 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 0 0 0 / 0)") is "color(xyz-d65 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 0 0 0 / 0)") is "color(xyz-d65 0 0 0 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 0 y z / alpha)") is "color(xyz-d65 0 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x 0 z / alpha)") is "color(xyz-d65 7 0 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y 0 / alpha)") is "color(xyz-d65 7 -20.5 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z / 0)") is "color(xyz-d65 7 -20.5 100 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 0 y z / alpha)") is "color(xyz-d65 0 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x 0 z / alpha)") is "color(xyz-d65 7 0 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x y 0 / alpha)") is "color(xyz-d65 7 -20.5 0 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x y z / 0)") is "color(xyz-d65 7 -20.5 100 / 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 0.2 y z / alpha)") is "color(xyz-d65 0.2 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x 0.2 z / alpha)") is "color(xyz-d65 7 0.2 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y 0.2 / alpha)") is "color(xyz-d65 7 -20.5 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z / 0.2)") is "color(xyz-d65 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z / 20%)") is "color(xyz-d65 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 0.2 y z / alpha)") is "color(xyz-d65 0.2 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x 0.2 z / alpha)") is "color(xyz-d65 7 0.2 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x y 0.2 / alpha)") is "color(xyz-d65 7 -20.5 0.2 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x y z / 0.2)") is "color(xyz-d65 7 -20.5 100 / 0.2)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 y z x)") is "color(xyz-d65 -20.5 100 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x x x / x)") is "color(xyz-d65 7 7 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 y z x)") is "color(xyz-d65 -20.5 100 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 x x x / x)") is "color(xyz-d65 7 7 7)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 z alpha x / y)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 alpha alpha alpha / alpha)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 z alpha x / y)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 alpha alpha alpha / alpha)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 calc(x) calc(y) calc(z))") is "color(xyz-d65 7 -20.5 100)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100 / 40%) xyz-d65 calc(x) calc(y) calc(z) / calc(alpha))") is "color(xyz-d65 7 -20.5 100 / 0.4)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 10deg y z)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x 10deg z)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y 10deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 x y z / 10deg)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 red y)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 r y z)") is "rgba(0, 0, 0, 0)"
+PASS computedStyle("background-color", "color(from color(xyz-d65 7 -20.5 100) xyz-d65 l y z)") is "rgba(0, 0, 0, 0)"
+
</ins><span class="cx"> Spec Examples
</span><span class="cx"> PASS computedStyle("background-color", "rgb(from var(--bg-color) r g b / 80%)") is "rgba(0, 0, 255, 0.8)"
</span><span class="cx"> PASS computedStyle("background-color", "lch(from var(--color) calc(l / 2) c h)") is "lch(23.138971% 67.989716 134.39125)"
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingrelativecolorsyntaxhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/parsing-relative-color-syntax.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-relative-color-syntax.html    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/fast/css/parsing-relative-color-syntax.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">     testComputed(`lch(from lch(70% 45 30) l g b)`, `rgba(0, 0, 0, 0)`);
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    for (const color of [ "srgb", "a98-rgb", "rec2020", "prophoto-rgb" ]) {
</del><ins>+    for (const color of [ "srgb", "srgb-linear", "a98-rgb", "rec2020", "prophoto-rgb" ]) {
</ins><span class="cx">         debug('');
</span><span class="cx">         debug('color(from ... ${color} ...)');
</span><span class="cx"> 
</span><span class="lines">@@ -515,70 +515,73 @@
</span><span class="cx">         testComputed(`color(from color(${color} 0.7 0.5 0.3) ${color} l g b)`,                              `rgba(0, 0, 0, 0)`);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    debug('');
-    debug('color(from ... xyz ...)');
</del><ins>+    for (const color of [ "xyz", "xyz-d50", "xyz-d65" ]) {
+           debug('');
+           debug(`color(from ... ${color} ...)`);
</ins><span class="cx"> 
</span><del>-    // Testing no modifications.
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y z)`,                              `color(xyz 7 -20.5 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y z / alpha)`,                      `color(xyz 7 -20.5 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x y z)`,                        `color(xyz 7 -20.5 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / alpha)`,                `color(xyz 7 -20.5 100 / 0.4)`);
</del><ins>+                const resultColorSpace = color == "xyz" ? "xyz-d65" : color; 
</ins><span class="cx"> 
</span><del>-    // Test nesting relative colors.
-    testComputed(`color(from color(from color(xyz 7 -20.5 100) xyz x y z) xyz x y z)`,        `color(xyz 7 -20.5 100)`);
</del><ins>+            // Testing no modifications.
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y z)`,                              `color(${resultColorSpace} 7 -20.5 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y z / alpha)`,                      `color(${resultColorSpace} 7 -20.5 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x y z)`,                        `color(${resultColorSpace} 7 -20.5 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x y z / alpha)`,                `color(${resultColorSpace} 7 -20.5 100 / 0.4)`);
</ins><span class="cx"> 
</span><del>-    // Testing replacement with 0.
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 0 0 0)`,                              `color(xyz 0 0 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 0 0 0)`,                              `color(xyz 0 0 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 0 0 0 / 0)`,                          `color(xyz 0 0 0 / 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 0 0 0 / 0)`,                          `color(xyz 0 0 0 / 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 0 y z / alpha)`,                      `color(xyz 0 -20.5 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x 0 z / alpha)`,                      `color(xyz 7 0 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y 0 / alpha)`,                      `color(xyz 7 -20.5 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y z / 0)`,                          `color(xyz 7 -20.5 100 / 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz 0 y z / alpha)`,                `color(xyz 0 -20.5 100 / 0.4)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x 0 z / alpha)`,                `color(xyz 7 0 100 / 0.4)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x y 0 / alpha)`,                `color(xyz 7 -20.5 0 / 0.4)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / 0)`,                    `color(xyz 7 -20.5 100 / 0)`);
</del><ins>+            // Test nesting relative colors.
+           testComputed(`color(from color(from color(${color} 7 -20.5 100) ${color} x y z) ${color} x y z)`,        `color(${resultColorSpace} 7 -20.5 100)`);
</ins><span class="cx"> 
</span><del>-    // Testing replacement with a constant.
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 0.2 y z / alpha)`,                    `color(xyz 0.2 -20.5 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x 0.2 z / alpha)`,                    `color(xyz 7 0.2 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y 0.2 / alpha)`,                    `color(xyz 7 -20.5 0.2)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y z / 0.2)`,                        `color(xyz 7 -20.5 100 / 0.2)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y z / 20%)`,                        `color(xyz 7 -20.5 100 / 0.2)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz 0.2 y z / alpha)`,              `color(xyz 0.2 -20.5 100 / 0.4)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x 0.2 z / alpha)`,              `color(xyz 7 0.2 100 / 0.4)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x y 0.2 / alpha)`,              `color(xyz 7 -20.5 0.2 / 0.4)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x y z / 0.2)`,                  `color(xyz 7 -20.5 100 / 0.2)`);
</del><ins>+            // Testing replacement with 0.
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 0 0 0)`,                              `color(${resultColorSpace} 0 0 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 0 0 0)`,                              `color(${resultColorSpace} 0 0 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 0 0 0 / 0)`,                          `color(${resultColorSpace} 0 0 0 / 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 0 0 0 / 0)`,                          `color(${resultColorSpace} 0 0 0 / 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 0 y z / alpha)`,                      `color(${resultColorSpace} 0 -20.5 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x 0 z / alpha)`,                      `color(${resultColorSpace} 7 0 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y 0 / alpha)`,                      `color(${resultColorSpace} 7 -20.5 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y z / 0)`,                          `color(${resultColorSpace} 7 -20.5 100 / 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} 0 y z / alpha)`,                `color(${resultColorSpace} 0 -20.5 100 / 0.4)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x 0 z / alpha)`,                `color(${resultColorSpace} 7 0 100 / 0.4)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x y 0 / alpha)`,                `color(${resultColorSpace} 7 -20.5 0 / 0.4)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x y z / 0)`,                    `color(${resultColorSpace} 7 -20.5 100 / 0)`);
</ins><span class="cx"> 
</span><del>-    // Testing valid permutation (types match).
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz y z x)`,                              `color(xyz -20.5 100 7)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x x x / x)`,                          `color(xyz 7 7 7)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz y z x)`,                        `color(xyz -20.5 100 7)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz x x x / x)`,                    `color(xyz 7 7 7)`);
</del><ins>+            // Testing replacement with a constant.
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 0.2 y z / alpha)`,                    `color(${resultColorSpace} 0.2 -20.5 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x 0.2 z / alpha)`,                    `color(${resultColorSpace} 7 0.2 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y 0.2 / alpha)`,                    `color(${resultColorSpace} 7 -20.5 0.2)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y z / 0.2)`,                        `color(${resultColorSpace} 7 -20.5 100 / 0.2)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y z / 20%)`,                        `color(${resultColorSpace} 7 -20.5 100 / 0.2)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} 0.2 y z / alpha)`,              `color(${resultColorSpace} 0.2 -20.5 100 / 0.4)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x 0.2 z / alpha)`,              `color(${resultColorSpace} 7 0.2 100 / 0.4)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x y 0.2 / alpha)`,              `color(${resultColorSpace} 7 -20.5 0.2 / 0.4)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x y z / 0.2)`,                  `color(${resultColorSpace} 7 -20.5 100 / 0.2)`);
</ins><span class="cx"> 
</span><del>-    // Testing invalid permutation (types don't match).
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz z alpha x / y)`,                      `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz alpha alpha alpha / alpha)`,          `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz z alpha x / y)`,                `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz alpha alpha alpha / alpha)`,    `rgba(0, 0, 0, 0)`);
</del><ins>+            // Testing valid permutation (types match).
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} y z x)`,                              `color(${resultColorSpace} -20.5 100 7)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x x x / x)`,                          `color(${resultColorSpace} 7 7 7)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} y z x)`,                        `color(${resultColorSpace} -20.5 100 7)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} x x x / x)`,                    `color(${resultColorSpace} 7 7 7)`);
</ins><span class="cx"> 
</span><del>-    // Testing with calc().
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz calc(x) calc(y) calc(z))`,                        `color(xyz 7 -20.5 100)`);
-    testComputed(`color(from color(xyz 7 -20.5 100 / 40%) xyz calc(x) calc(y) calc(z) / calc(alpha))`,    `color(xyz 7 -20.5 100 / 0.4)`);
</del><ins>+            // Testing invalid permutation (types don't match).
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} z alpha x / y)`,                      `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} alpha alpha alpha / alpha)`,          `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} z alpha x / y)`,                `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} alpha alpha alpha / alpha)`,    `rgba(0, 0, 0, 0)`);
</ins><span class="cx"> 
</span><del>-    // Testing invalid values.
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz 10deg y z)`,                          `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x 10deg z)`,                          `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y 10deg)`,                          `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz x y z / 10deg)`,                      `rgba(0, 0, 0, 0)`);
</del><ins>+            // Testing with calc().
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} calc(x) calc(y) calc(z))`,                        `color(${resultColorSpace} 7 -20.5 100)`);
+           testComputed(`color(from color(${color} 7 -20.5 100 / 40%) ${color} calc(x) calc(y) calc(z) / calc(alpha))`,    `color(${resultColorSpace} 7 -20.5 100 / 0.4)`);
</ins><span class="cx"> 
</span><del>-    // Testing invalid component names
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz red y)`,                              `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz r y z)`,                              `rgba(0, 0, 0, 0)`);
-    testComputed(`color(from color(xyz 7 -20.5 100) xyz l y z)`,                              `rgba(0, 0, 0, 0)`);
</del><ins>+            // Testing invalid values.
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} 10deg y z)`,                          `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x 10deg z)`,                          `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y 10deg)`,                          `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} x y z / 10deg)`,                      `rgba(0, 0, 0, 0)`);
</ins><span class="cx"> 
</span><ins>+           // Testing invalid component names
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} red y)`,                              `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} r y z)`,                              `rgba(0, 0, 0, 0)`);
+           testComputed(`color(from color(${color} 7 -20.5 100) ${color} l y z)`,                              `rgba(0, 0, 0, 0)`);
+       }
</ins><span class="cx"> 
</span><span class="cx">     debug('');
</span><span class="cx">     debug('Spec Examples');
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2021-11-25  Sam Weinig  <weinig@apple.com>
+
+        [CSS Color 4] Add support for new srgb-linear, xyz-d50 and xyz-d65 colorspaces
+        https://bugs.webkit.org/show_bug.cgi?id=233475
+
+        Reviewed by Dean Jackson.
+
+        Update existing color(xyz ...) tests for new d65 whitepoint and add new tests
+        for color(srgb-linear ...), color(xyz-d50 ...) and color(xyz-d65 ...).
+
+        * web-platform-tests/css/css-color/predefined-016.html:
+        * web-platform-tests/css/css-color/srgb-linear-001-expected.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-001.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-002-expected.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-002.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-003-expected.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-003.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-004-expected.html: Added.
+        * web-platform-tests/css/css-color/srgb-linear-004.html: Added.
+        * web-platform-tests/css/css-color/xyz-001.html:
+        * web-platform-tests/css/css-color/xyz-003-expected.html:
+        * web-platform-tests/css/css-color/xyz-003.html:
+        * web-platform-tests/css/css-color/xyz-004-expected.html:
+        * web-platform-tests/css/css-color/xyz-004.html:
+        * web-platform-tests/css/css-color/xyz-005.html:
+        * web-platform-tests/css/css-color/xyz-d50-001-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-001.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-002-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-002.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-003-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-003.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-004-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-004.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-005-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d50-005.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-001-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-001.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-002-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-002.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-003-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-003.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-004-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-004.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-005-expected.html: Added.
+        * web-platform-tests/css/css-color/xyz-d65-005.html: Added.
+
</ins><span class="cx"> 2021-11-24  Tim Nguyen  <ntim@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Re-import html/semantics/interactive-elements/the-dialog-element WPT
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorpredefined016html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/predefined-016.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/predefined-016.html      2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/predefined-016.html 2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> <style>
</span><span class="cx">     .test { background-color: red; width: 12em; height: 6em; margin-top:0}
</span><span class="cx">     .ref { background-color: #009900; width: 12em; height: 6em; margin-bottom: 0}
</span><del>-    .test {background-color: color(xyz 0.12266 0.22836 0.03093)}
</del><ins>+    .test {background-color: color(xyz 0.11391 0.22781 0.03797)}
</ins><span class="cx"> </style>
</span><span class="cx"> <body>
</span><span class="cx">     <p>Test passes if you see a green square, and no red.</p>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear001expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001-expected.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001-expected.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Green square reference</title>
+<style>
+    .test { background-color: #008000; width: 12em; height: 12em;}
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear001htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-001.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: srgb-linear</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-srgb-linear">
+<link rel="match" href="greensquare-ref.html">
+<meta name="assert" content="srgb-linear with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 12em; }
+    .test { background-color: color(srgb-linear 0 0.21586 0); } /* green (sRGB #008000) converted to srgb-linear */
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear002expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002-expected.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002-expected.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Black square reference</title>
+<style>
+    .test { background-color: #000000; width: 12em; height: 12em; }
+</style>
+<body>
+    <p>Test passes if you see a black square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear002html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-002.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: srgb-linear</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-srgb-linear">
+<link rel="match" href="blacksquare-ref.html">
+<meta name="assert" content="srgb-linear with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 12em; }
+    .test { background-color: color(srgb-linear 0 0 0); } /* black (sRGB #000000) converted to srgb-linear */
+</style>
+<body>
+    <p>Test passes if you see a black square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear003expectedhtmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003expectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003-expected.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003-expected.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003-expected.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: CSS Color 4: srgb-linear</title>
+<style>
+    body { background-color: grey; }
+    .test { background-color: color(srgb 1 1 1); width: 12em; height: 12em; } /* color(srgb-linear 1 1 1) converted to sRGB */
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear003htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-003.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: srgb-linear</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-srgb-linear">
+<link rel="match" href="a98rgb-003-ref.html">
+<meta name="assert" content="srgb-linear with no alpha">
+<style>
+    body { background-color: grey; }
+    .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
+    .ref { background-color: color(srgb 1 1 1); width: 12em; height: 6em; margin-bottom: 0; } /* color(srgb-linear 1 1 1) converted to sRGB */
+    .test { background-color: color(srgb-linear 1 1 1); }
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="ref"></div>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear004expectedhtmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004expectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004-expected.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004-expected.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004-expected.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: CSS Color 4: srgb-linear</title>
+<style>
+    .test { background-color: lab(87.8185% -79.271 80.9946); width: 12em; height: 12em; } /* color(srgb-linear 0 1 0) converted to Lab */
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorsrgblinear004htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/srgb-linear-004.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: srgb-linear</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-srgb-linear">
+<link rel="match" href="a98rgb-004-ref.html">
+<meta name="assert" content="srgb-linear with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
+    .ref { background-color: lab(87.8185% -79.271 80.9946); width: 12em; height: 6em; margin-bottom: 0; } /* color(srgb-linear 0 1 0) converted to Lab */
+    .test { background-color: color(srgb-linear 0 1 0); }
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="ref"></div>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html     2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> <meta name="assert" content="xyz with no alpha">
</span><span class="cx"> <style>
</span><span class="cx">     .test { background-color: red; width: 12em; height: 12em; }
</span><del>-    .test { background-color: color(xyz 0.08312 0.154746 0.020961); } /* green (sRGB #008000) converted to xyz */
</del><ins>+    .test { background-color: color(xyz 0.07719 0.15438 0.02573); } /* green (sRGB #008000) converted to xyz */
</ins><span class="cx"> </style>
</span><span class="cx"> <body>
</span><span class="cx">     <p>Test passes if you see a green square, and no red.</p>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003expectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> <title>CSS Color 4: CSS Color 4: xyz</title>
</span><span class="cx"> <style>
</span><span class="cx">     body { background-color: grey; }
</span><del>-    .test { background-color: lab(100% 6.1097 -13.2268); width: 12em; height: 12em; } /* color(xyz 1 1 1) converted to Lab */
</del><ins>+    .test { background-color: lab(100.115% 9.06448 5.80177); width: 12em; height: 12em; } /* color(xyz 1 1 1) converted to Lab */
</ins><span class="cx"> </style>
</span><span class="cx"> <body>
</span><span class="cx">     <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html     2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> <style>
</span><span class="cx">     body { background-color: grey; }
</span><span class="cx">     .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
</span><del>-    .ref { background-color: lab(100% 6.1097 -13.2268); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz 1 1 1) converted to Lab */
</del><ins>+    .ref { background-color: lab(100.115% 9.06448 5.80177); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz 1 1 1) converted to Lab */
</ins><span class="cx">     .test { background-color: color(xyz 1 1 1); }
</span><span class="cx"> </style>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004expectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <title>CSS Color 4: CSS Color 4: xyz</title>
</span><span class="cx"> <style>
</span><del>-    .test { background-color: lab(100% -431.0345 172.4138); width: 12em; height: 12em; } /* color(xyz 0 1 0) converted to Lab */
</del><ins>+    .test { background-color: lab(99.6289% -354.58 146.707); width: 12em; height: 12em; } /* color(xyz 0 1 0) converted to Lab */
</ins><span class="cx"> </style>
</span><span class="cx"> <body>
</span><span class="cx">     <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004.html     2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> <meta name="assert" content="xyz with no alpha">
</span><span class="cx"> <style>
</span><span class="cx">     .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
</span><del>-    .ref { background-color: lab(100% -431.0345 172.4138); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz 0 1 0) converted to Lab */
</del><ins>+    .ref { background-color: lab(99.6289% -354.58 146.707); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz 0 1 0) converted to Lab */
</ins><span class="cx">     .test { background-color: color(xyz 0 1 0); }
</span><span class="cx"> </style>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz005html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-005.html (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-005.html     2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-005.html        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> <meta name="assert" content="xyz outside the sRGB gamut">
</span><span class="cx"> <style>
</span><span class="cx">     .test { background-color: red; width: 12em; height: 12em; }
</span><del>-    .test { background-color: color(xyz 0.29194 0.692236 0.041884); } /* green color(display-p3 0 1 0) converted to xyz */
</del><ins>+    .test { background-color: color(xyz 0.26567 0.69174 0.04511); } /* green color(display-p3 0 1 0) converted to xyz */
</ins><span class="cx"> </style>
</span><span class="cx"> <body>
</span><span class="cx">     <p>Test passes if you see a green square, and no red.</p>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50001expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Green square reference</title>
+<style>
+    .test { background-color: #008000; width: 12em; height: 12em;}
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50001htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-001.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!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="greensquare-ref.html">
+<meta name="assert" content="xyz-d50 with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 12em; }
+    .test { background-color: color(xyz-d50 0.08312 0.154746 0.020961); } /* green (sRGB #008000) converted to xyz-d50 */
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50002expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Black square reference</title>
+<style>
+    .test { background-color: #000000; width: 12em; height: 12em; }
+</style>
+<body>
+    <p>Test passes if you see a black square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50002htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-002.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!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="blacksquare-ref.html">
+<meta name="assert" content="xyz-d50 with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 12em; }
+    .test { background-color: color(xyz-d50 0 0 0); } /* black (sRGB #000000) converted to xyz-d50 */
+</style>
+<body>
+    <p>Test passes if you see a black square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50003expectedhtmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003expectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003-expected.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: CSS Color 4: xyz-d50</title>
+<style>
+    body { background-color: grey; }
+    .test { background-color: lab(100% 6.1097 -13.2268); width: 12em; height: 12em; } /* color(xyz-d50 1 1 1) converted to Lab */
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50003htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-003.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!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="xyz-d50-003-ref.html">
+<meta name="assert" content="xyz-d50 with no alpha">
+<style>
+    body { background-color: grey; }
+    .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
+    .ref { background-color: lab(100% 6.1097 -13.2268); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz-d50 1 1 1) converted to Lab */
+    .test { background-color: color(xyz-d50 1 1 1); }
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="ref"></div>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50004expectedhtmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004expectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004-expected.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: CSS Color 4: xyz-d50</title>
+<style>
+    .test { background-color: lab(100% -431.0345 172.4138); width: 12em; height: 12em; } /* color(xyz-d50 0 1 0) converted to Lab */
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50004htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-004.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+<!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="xyz-d50-004-ref.html">
+<meta name="assert" content="xyz-d50 with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
+    .ref { background-color: lab(100% -431.0345 172.4138); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz-d50 0 1 0) converted to Lab */
+    .test { background-color: color(xyz-d50 0 1 0); }
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="ref"></div>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50005expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Green square color(display-p3 0 1 0) reference</title>
+<style>
+    .test { background-color: color(display-p3 0 1 0); width: 12em; height: 12em; }
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd50005htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz005html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-005.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d50-005.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!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="greensquare-display-p3-ref.html">
+<meta name="assert" content="xyz-d50 outside the sRGB gamut">
+<style>
+    .test { background-color: red; width: 12em; height: 12em; }
+    .test { background-color: color(xyz-d50 0.29194 0.692236 0.041884); } /* green color(display-p3 0 1 0) converted to xyz-d50 */
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65001expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Green square reference</title>
+<style>
+    .test { background-color: #008000; width: 12em; height: 12em;}
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65001htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-001.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!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="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>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65002expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Black square reference</title>
+<style>
+    .test { background-color: #000000; width: 12em; height: 12em; }
+</style>
+<body>
+    <p>Test passes if you see a black square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65002htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz001html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-001.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-002.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!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="blacksquare-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 0 0); } /* black (sRGB #000000) converted to xyz-d65 */
+</style>
+<body>
+    <p>Test passes if you see a black square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65003expectedhtmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003expectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003-expected.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003-expected.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: CSS Color 4: xyz-d65</title>
+<style>
+    body { background-color: grey; }
+    .test { background-color: lab(100.115% 9.06448 5.80177); width: 12em; height: 12em; } /* color(xyz-d65 1 1 1) converted to Lab */
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65003htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz003html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-003.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-003.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!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="xyz-d65-003-ref.html">
+<meta name="assert" content="xyz-d65 with no alpha">
+<style>
+    body { background-color: grey; }
+    .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
+    .ref { background-color: lab(100.115% 9.06448 5.80177); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz-d65 1 1 1) converted to Lab */
+    .test { background-color: color(xyz-d65 1 1 1); }
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="ref"></div>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65004expectedhtmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004expectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004-expected.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004-expected.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Color 4: CSS Color 4: xyz-d65</title>
+<style>
+    .test { background-color: lab(99.6289% -354.58 146.707); width: 12em; height: 12em; } /* color(xyz-d65 0 1 0) converted to Lab */
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65004htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz004html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-004.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-004.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+<!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="xyz-d65-004-ref.html">
+<meta name="assert" content="xyz-d65 with no alpha">
+<style>
+    .test { background-color: red; width: 12em; height: 6em; margin-top: 0; }
+    .ref { background-color: lab(99.6289% -354.58 146.707); width: 12em; height: 6em; margin-bottom: 0; } /* color(xyz-d65 0 1 0) converted to Lab */
+    .test { background-color: color(xyz-d65 0 1 0); }
+</style>
+<body>
+    <p>Test passes if you see a single square, and not two rectangles of different colors.</p>
+    <div class="ref"></div>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65005expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005-expected.html (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005-expected.html   2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Green square color(display-p3 0 1 0) reference</title>
+<style>
+    .test { background-color: color(display-p3 0 1 0); width: 12em; height: 12em; }
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyzd65005htmlfromrev286167trunkLayoutTestsimportedw3cwebplatformtestscsscsscolorxyz005html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005.html (from rev 286167, trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-005.html) (0 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/xyz-d65-005.html    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!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="greensquare-display-p3-ref.html">
+<meta name="assert" content="xyz-d65 outside the sRGB gamut">
+<style>
+    .test { background-color: red; width: 12em; height: 12em; }
+    .test { background-color: color(xyz-d65 0.26567 0.69174 0.04511); } /* green color(display-p3 0 1 0) converted to xyz-d65 */
+</style>
+<body>
+    <p>Test passes if you see a green square, and no red.</p>
+    <div class="test"></div>
+</body>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/ChangeLog      2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2021-11-25  Sam Weinig  <weinig@apple.com>
+
+        [CSS Color 4] Add support for new srgb-linear, xyz-d50 and xyz-d65 colorspaces
+        https://bugs.webkit.org/show_bug.cgi?id=233475
+
+        Reviewed by Dean Jackson.
+
+        Updates existing tests to add cases for the new colorspaces.
+
+        - Adds support for color(srgb-linear ...), color(xyz-d50 ...) and color(xyz-d65 ...)
+        - Updates color(xyz ...) to be an alias of color(xyz-d65 ...), which is a breaking change
+          both because previously it used the d50 white point and because we now serialize it
+          as color(xyz-d65 ...). We think this is acceptable as we just shipped the feature and
+          no other browsers yet support it.
+        - Adds support for color-mix(in xyz-d50, ...) and color-mix(in xyz-d65, ...).
+        - Updates color-mix(in xyz, ...) to use the d65 white point (like above). We have not shipped
+          color-mix enabled, so this should even less controvertial.
+
+        * css/CSSValueKeywords.in:
+        Add new keywords.
+
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionForRGBTypes):
+        (WebCore::CSSPropertyParserHelpers::parseColorFunctionForRGBTypes):
+        (WebCore::CSSPropertyParserHelpers::parseColorFunctionForXYZTypes):
+        (WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionForXYZTypes):
+        (WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionParameters):
+        (WebCore::CSSPropertyParserHelpers::parseNonRelativeColorFunctionParameters):
+        (WebCore::CSSPropertyParserHelpers::consumeColorMixColorSpaceAndComma):
+        (WebCore::CSSPropertyParserHelpers::mixColorComponents):
+        Add/update parsing support for new/updated colorspaces. parseColorFunctionForXYZTypes
+        is now templatized like parseColorFunctionForRGBTypes to allow reusing it for each
+        of the XYZ types.
+
+        * platform/graphics/ColorSpace.h:
+        (WebCore::callWithColorType):
+        * platform/graphics/ColorSpace.cpp:
+        (WebCore::operator<<):
+        * platform/graphics/ColorConversion.cpp:
+        (WebCore::converColorComponents):
+        Add new "named" colorspace, XYZ_D65, so that color(xyz-d65 ...) can be piped through
+        and serialized correctly. We already had a name for srgb-linear (though it was not
+        possible to create it from css previously) so no new name was needed for it.
+
+        * platform/graphics/ColorSerialization.cpp:
+        (WebCore::serialization):
+        (WebCore::serializationForCSS):
+        (WebCore::serializationForHTML):
+        (WebCore::serializationForRenderTreeAsText):
+        Add serialization specialization for xyz-d50/xyz-d65 and update name of LinearSRGBA
+        to "srgb-linear" to match the now defined name in css. 
+
+        * platform/graphics/cg/ColorCG.cpp:
+        (WebCore::Color::createAndLosslesslyConvertToSupportedColorSpace):
+        * platform/graphics/cg/ColorSpaceCG.cpp:
+        (WebCore::xyzD50ColorSpaceRef):
+        (WebCore::colorSpaceForCGColorSpace):
+        (WebCore::xyzColorSpaceRef): Deleted.
+        * platform/graphics/cg/ColorSpaceCG.h:
+        (WebCore::cachedNullableCGColorSpace):
+        Updates xyzColorSpaceRef() function to be named xyzD50ColorSpaceRef() to more accurately
+        state what it is. It is not yet clear how or if an xyz-d65 colorspace can be created in
+        CoreGraphics, so we return nullptr when requested. This does not change any rendered values
+        as we can convert to extended-srgb in that case (as we do with lab and lch) without any loss.
+
</ins><span class="cx"> 2021-11-25  Kimmo Kinnunen  <kkinnunen@apple.com>
</span><span class="cx"> 
</span><span class="cx">         GraphicsContextGL implementations should have separate class definitions
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in     2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -1469,7 +1469,10 @@
</span><span class="cx"> prophoto-rgb
</span><span class="cx"> // rec2020
</span><span class="cx"> // sRGB
</span><ins>+srgb-linear
</ins><span class="cx"> xyz
</span><ins>+xyz-d50
+xyz-d65
</ins><span class="cx"> 
</span><span class="cx"> // color-contast()
</span><span class="cx"> color-contrast
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp     2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -2013,10 +2013,10 @@
</span><span class="cx"> 
</span><span class="cx"> template<typename ColorType> static Color parseRelativeColorFunctionForRGBTypes(CSSParserTokenRange& args, Color originColor, const CSSParserContext& context)
</span><span class="cx"> {
</span><del>-    ASSERT(args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueDisplayP3 || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020 || args.peek().id() == CSSValueSRGB);
</del><ins>+    ASSERT(args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueDisplayP3 || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020 || args.peek().id() == CSSValueSRGB || args.peek().id() == CSSValueSrgbLinear);
</ins><span class="cx"> 
</span><span class="cx">     // Support sRGB and Display-P3 regardless of the setting as we have shipped support for them for a while.
</span><del>-    if (!context.cssColor4 && (args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020))
</del><ins>+    if (!context.cssColor4 && (args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020 || args.peek().id() == CSSValueSrgbLinear))
</ins><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="cx">     consumeIdentRaw(args);
</span><span class="lines">@@ -2038,10 +2038,10 @@
</span><span class="cx"> 
</span><span class="cx"> template<typename ColorType> static Color parseColorFunctionForRGBTypes(CSSParserTokenRange& args, const CSSParserContext& context)
</span><span class="cx"> {
</span><del>-    ASSERT(args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueDisplayP3 || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020 || args.peek().id() == CSSValueSRGB);
</del><ins>+    ASSERT(args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueDisplayP3 || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020 || args.peek().id() == CSSValueSRGB || args.peek().id() == CSSValueSrgbLinear);
</ins><span class="cx"> 
</span><span class="cx">     // Support sRGB and Display-P3 regardless of the setting as we have shipped support for them for a while.
</span><del>-    if (!context.cssColor4 && (args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020))
</del><ins>+    if (!context.cssColor4 && (args.peek().id() == CSSValueA98Rgb || args.peek().id() == CSSValueProphotoRgb || args.peek().id() == CSSValueRec2020 || args.peek().id() == CSSValueSrgbLinear))
</ins><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="cx">     consumeIdentRaw(args);
</span><span class="lines">@@ -2052,8 +2052,8 @@
</span><span class="cx">     return parseColorFunctionForRGBTypes<ColorType>(args, WTFMove(consumeRGB), WTFMove(consumeAlpha));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename ConsumerForXYZ, typename ConsumerForAlpha>
-static Color parseColorFunctionForXYZParameters(CSSParserTokenRange& args, ConsumerForXYZ&& xyzConsumer, ConsumerForAlpha&& alphaConsumer)
</del><ins>+template<typename ColorType, typename ConsumerForXYZ, typename ConsumerForAlpha>
+static Color parseColorFunctionForXYZTypes(CSSParserTokenRange& args, ConsumerForXYZ&& xyzConsumer, ConsumerForAlpha&& alphaConsumer)
</ins><span class="cx"> {
</span><span class="cx">     double channels[3] = { 0, 0, 0 };
</span><span class="cx">     for (auto& channel : channels) {
</span><span class="lines">@@ -2070,12 +2070,12 @@
</span><span class="cx">     if (!args.atEnd())
</span><span class="cx">         return { };
</span><span class="cx"> 
</span><del>-    return { XYZA<float, WhitePoint::D50> { static_cast<float>(channels[0]), static_cast<float>(channels[1]), static_cast<float>(channels[2]), static_cast<float>(*alpha) }, Color::Flags::UseColorFunctionSerialization };
</del><ins>+    return { ColorType { static_cast<float>(channels[0]), static_cast<float>(channels[1]), static_cast<float>(channels[2]), static_cast<float>(*alpha) }, Color::Flags::UseColorFunctionSerialization };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Color parseRelativeColorFunctionForXYZParameters(CSSParserTokenRange& args, Color originColor, const CSSParserContext& context)
</del><ins>+template<typename ColorType> static Color parseRelativeColorFunctionForXYZTypes(CSSParserTokenRange& args, Color originColor, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>-    ASSERT(args.peek().id() == CSSValueXyz);
</del><ins>+    ASSERT(args.peek().id() == CSSValueXyz || args.peek().id() == CSSValueXyzD50 || args.peek().id() == CSSValueXyzD65);
</ins><span class="cx"> 
</span><span class="cx">     if (!context.cssColor4)
</span><span class="cx">         return { };
</span><span class="lines">@@ -2082,7 +2082,7 @@
</span><span class="cx"> 
</span><span class="cx">     consumeIdentRaw(args);
</span><span class="cx"> 
</span><del>-    auto originColorAsXYZ = originColor.toColorTypeLossy<XYZA<float, WhitePoint::D50>>();
</del><ins>+    auto originColorAsXYZ = originColor.toColorTypeLossy<ColorType>();
</ins><span class="cx"> 
</span><span class="cx">     CSSCalcSymbolTable symbolTable {
</span><span class="cx">         { CSSValueX, CSSUnitType::CSS_NUMBER, originColorAsXYZ.x },
</span><span class="lines">@@ -2094,12 +2094,12 @@
</span><span class="cx">     auto consumeXYZ = [&symbolTable](auto& args) { return consumeNumberAllowingSymbolTableIdent(args, symbolTable); };
</span><span class="cx">     auto consumeAlpha = [&symbolTable](auto& args) { return consumeOptionalAlphaAllowingSymbolTableIdent(args, symbolTable); };
</span><span class="cx"> 
</span><del>-    return parseColorFunctionForXYZParameters(args, WTFMove(consumeXYZ), WTFMove(consumeAlpha));
</del><ins>+    return parseColorFunctionForXYZTypes<ColorType>(args, WTFMove(consumeXYZ), WTFMove(consumeAlpha));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Color parseColorFunctionForXYZParameters(CSSParserTokenRange& args, const CSSParserContext& context)
</del><ins>+template<typename ColorType> static Color parseColorFunctionForXYZTypes(CSSParserTokenRange& args, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>-    ASSERT(args.peek().id() == CSSValueXyz);
</del><ins>+    ASSERT(args.peek().id() == CSSValueXyz || args.peek().id() == CSSValueXyzD50 || args.peek().id() == CSSValueXyzD65);
</ins><span class="cx"> 
</span><span class="cx">     if (!context.cssColor4)
</span><span class="cx">         return { };
</span><span class="lines">@@ -2109,7 +2109,7 @@
</span><span class="cx">     auto consumeXYZ = [](auto& args) { return consumeNumberRaw(args); };
</span><span class="cx">     auto consumeAlpha = [](auto& args) { return consumeOptionalAlpha(args); };
</span><span class="cx"> 
</span><del>-    return parseColorFunctionForXYZParameters(args, WTFMove(consumeXYZ), WTFMove(consumeAlpha));
</del><ins>+    return parseColorFunctionForXYZTypes<ColorType>(args, WTFMove(consumeXYZ), WTFMove(consumeAlpha));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Color parseRelativeColorFunctionParameters(CSSParserTokenRange& args, const CSSParserContext& context)
</span><span class="lines">@@ -2132,8 +2132,13 @@
</span><span class="cx">         return parseRelativeColorFunctionForRGBTypes<Rec2020<float>>(args, WTFMove(originColor), context);
</span><span class="cx">     case CSSValueSRGB:
</span><span class="cx">         return parseRelativeColorFunctionForRGBTypes<SRGBA<float>>(args, WTFMove(originColor), context);
</span><ins>+    case CSSValueSrgbLinear:
+        return parseRelativeColorFunctionForRGBTypes<LinearSRGBA<float>>(args, WTFMove(originColor), context);
+    case CSSValueXyzD50:
+        return parseRelativeColorFunctionForXYZTypes<XYZA<float, WhitePoint::D50>>(args, WTFMove(originColor), context);
</ins><span class="cx">     case CSSValueXyz:
</span><del>-        return parseRelativeColorFunctionForXYZParameters(args, WTFMove(originColor), context);
</del><ins>+    case CSSValueXyzD65:
+        return parseRelativeColorFunctionForXYZTypes<XYZA<float, WhitePoint::D65>>(args, WTFMove(originColor), context);
</ins><span class="cx">     default:
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><span class="lines">@@ -2155,8 +2160,13 @@
</span><span class="cx">         return parseColorFunctionForRGBTypes<Rec2020<float>>(args, context);
</span><span class="cx">     case CSSValueSRGB:
</span><span class="cx">         return parseColorFunctionForRGBTypes<SRGBA<float>>(args, context);
</span><ins>+    case CSSValueSrgbLinear:
+        return parseColorFunctionForRGBTypes<LinearSRGBA<float>>(args, context);
+    case CSSValueXyzD50:
+        return parseColorFunctionForXYZTypes<XYZA<float, WhitePoint::D50>>(args, context);
</ins><span class="cx">     case CSSValueXyz:
</span><del>-        return parseColorFunctionForXYZParameters(args, context);
</del><ins>+    case CSSValueXyzD65:
+        return parseColorFunctionForXYZTypes<XYZA<float, WhitePoint::D65>>(args, context);
</ins><span class="cx">     default:
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><span class="lines">@@ -2275,12 +2285,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> enum class ColorMixColorSpace {
</span><del>-    Srgb,
</del><span class="cx">     Hsl,
</span><span class="cx">     Hwb,
</span><del>-    Xyz,
</del><span class="cx">     Lab,
</span><del>-    Lch
</del><ins>+    Lch,
+    Srgb,
+    XyzD50,
+    XyzD65
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static std::optional<ColorMixColorSpace> consumeColorMixColorSpaceAndComma(CSSParserTokenRange& args)
</span><span class="lines">@@ -2297,14 +2308,17 @@
</span><span class="cx">         return consumeIdentAndComma(args, ColorMixColorSpace::Hsl);
</span><span class="cx">     case CSSValueHwb:
</span><span class="cx">         return consumeIdentAndComma(args, ColorMixColorSpace::Hwb);
</span><ins>+    case CSSValueLab:
+        return consumeIdentAndComma(args, ColorMixColorSpace::Lab);
</ins><span class="cx">     case CSSValueLch:
</span><span class="cx">         return consumeIdentAndComma(args, ColorMixColorSpace::Lch);
</span><del>-    case CSSValueLab:
-        return consumeIdentAndComma(args, ColorMixColorSpace::Lab);
-    case CSSValueXyz:
-        return consumeIdentAndComma(args, ColorMixColorSpace::Xyz);
</del><span class="cx">     case CSSValueSRGB:
</span><span class="cx">         return consumeIdentAndComma(args, ColorMixColorSpace::Srgb);
</span><ins>+    case CSSValueXyzD50:
+        return consumeIdentAndComma(args, ColorMixColorSpace::XyzD50);
+    case CSSValueXyz:
+    case CSSValueXyzD65:
+        return consumeIdentAndComma(args, ColorMixColorSpace::XyzD65);
</ins><span class="cx">     default:
</span><span class="cx">         return std::nullopt;
</span><span class="cx">     }
</span><span class="lines">@@ -2449,14 +2463,16 @@
</span><span class="cx">         return mixColorComponentsInColorSpace<HSLA<float>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</span><span class="cx">     case ColorMixColorSpace::Hwb:
</span><span class="cx">         return mixColorComponentsInColorSpace<HWBA<float>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</span><ins>+    case ColorMixColorSpace::Lab:
+        return mixColorComponentsInColorSpace<Lab<float>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</ins><span class="cx">     case ColorMixColorSpace::Lch:
</span><span class="cx">         return mixColorComponentsInColorSpace<LCHA<float>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</span><del>-    case ColorMixColorSpace::Lab:
-        return mixColorComponentsInColorSpace<Lab<float>>(mixPercentages, mixComponents1.color, mixComponents2.color);
-    case ColorMixColorSpace::Xyz:
-        return mixColorComponentsInColorSpace<XYZA<float, WhitePoint::D50>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</del><span class="cx">     case ColorMixColorSpace::Srgb:
</span><span class="cx">         return mixColorComponentsInColorSpace<SRGBA<float>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</span><ins>+    case ColorMixColorSpace::XyzD50:
+        return mixColorComponentsInColorSpace<XYZA<float, WhitePoint::D50>>(mixPercentages, mixComponents1.color, mixComponents2.color);
+    case ColorMixColorSpace::XyzD65:
+        return mixColorComponentsInColorSpace<XYZA<float, WhitePoint::D65>>(mixPercentages, mixComponents1.color, mixComponents2.color);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorConversioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorConversion.cpp (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorConversion.cpp       2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/ColorConversion.cpp  2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -297,6 +297,8 @@
</span><span class="cx">             return asColorComponents(convertColor<SRGBA<float>>(inputColor));
</span><span class="cx">         case ColorSpace::XYZ_D50:
</span><span class="cx">             return asColorComponents(convertColor<XYZA<float, WhitePoint::D50>>(inputColor));
</span><ins>+        case ColorSpace::XYZ_D65:
+            return asColorComponents(convertColor<XYZA<float, WhitePoint::D65>>(inputColor));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorSerializationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorSerialization.cpp (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorSerialization.cpp    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/ColorSerialization.cpp       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -75,7 +75,11 @@
</span><span class="cx"> static String serializationForHTML(const XYZA<float, WhitePoint::D50>&, bool useColorFunctionSerialization);
</span><span class="cx"> static String serializationForRenderTreeAsText(const XYZA<float, WhitePoint::D50>&, bool useColorFunctionSerialization);
</span><span class="cx"> 
</span><ins>+static String serializationForCSS(const XYZA<float, WhitePoint::D65>&, bool useColorFunctionSerialization);
+static String serializationForHTML(const XYZA<float, WhitePoint::D65>&, bool useColorFunctionSerialization);
+static String serializationForRenderTreeAsText(const XYZA<float, WhitePoint::D65>&, bool useColorFunctionSerialization);
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> String serializationForCSS(const Color& color)
</span><span class="cx"> {
</span><span class="cx">     return color.callOnUnderlyingType([&] (auto underlyingColor) {
</span><span class="lines">@@ -109,7 +113,7 @@
</span><span class="cx">     case ColorSpace::Lab:
</span><span class="cx">         return "lab"_s;
</span><span class="cx">     case ColorSpace::LinearSRGB:
</span><del>-        return "linear-srgb"_s;
</del><ins>+        return "srgb-linear"_s;
</ins><span class="cx">     case ColorSpace::ProPhotoRGB:
</span><span class="cx">         return "prophoto-rgb"_s;
</span><span class="cx">     case ColorSpace::Rec2020:
</span><span class="lines">@@ -117,7 +121,9 @@
</span><span class="cx">     case ColorSpace::SRGB:
</span><span class="cx">         return "srgb"_s;
</span><span class="cx">     case ColorSpace::XYZ_D50:
</span><del>-        return "xyz"_s;
</del><ins>+        return "xyz-d50"_s;
+    case ColorSpace::XYZ_D65:
+        return "xyz-d65"_s;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -371,4 +377,21 @@
</span><span class="cx">     return serializationUsingColorFunction(color);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// MARK: XYZA<float, WhitePoint::D65> overloads
+
+String serializationForCSS(const XYZA<float, WhitePoint::D65>& color, bool)
+{
+    return serializationUsingColorFunction(color);
</ins><span class="cx"> }
</span><ins>+
+String serializationForHTML(const XYZA<float, WhitePoint::D65>& color, bool)
+{
+    return serializationUsingColorFunction(color);
+}
+
+String serializationForRenderTreeAsText(const XYZA<float, WhitePoint::D65>& color, bool)
+{
+    return serializationUsingColorFunction(color);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorSpacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorSpace.cpp (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorSpace.cpp    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/ColorSpace.cpp       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -58,8 +58,11 @@
</span><span class="cx">         ts << "sRGB";
</span><span class="cx">         break;
</span><span class="cx">     case ColorSpace::XYZ_D50:
</span><del>-        ts << "XYZ";
</del><ins>+        ts << "XYZ-D50";
</ins><span class="cx">         break;
</span><ins>+    case ColorSpace::XYZ_D65:
+        ts << "XYZ-D50";
+        break;
</ins><span class="cx">     }
</span><span class="cx">     return ts;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorSpaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorSpace.h (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorSpace.h      2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/ColorSpace.h 2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx">     Rec2020,
</span><span class="cx">     SRGB,
</span><span class="cx">     XYZ_D50,
</span><ins>+    XYZ_D65,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT TextStream& operator<<(TextStream&, ColorSpace);
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> template<typename T> struct ColorSpaceMapping<Rec2020<T>> { static constexpr auto colorSpace { ColorSpace::Rec2020 }; };
</span><span class="cx"> template<typename T> struct ColorSpaceMapping<SRGBA<T>> { static constexpr auto colorSpace { ColorSpace::SRGB }; };
</span><span class="cx"> template<typename T> struct ColorSpaceMapping<XYZA<T, WhitePoint::D50>> { static constexpr auto colorSpace { ColorSpace::XYZ_D50 }; };
</span><ins>+template<typename T> struct ColorSpaceMapping<XYZA<T, WhitePoint::D65>> { static constexpr auto colorSpace { ColorSpace::XYZ_D65 }; };
</ins><span class="cx"> 
</span><span class="cx"> template<typename ColorType> constexpr ColorSpace ColorSpaceFor = ColorSpaceMapping<ColorType>::colorSpace;
</span><span class="cx"> 
</span><span class="lines">@@ -82,6 +84,8 @@
</span><span class="cx">         return std::invoke(std::forward<Functor>(functor), makeFromComponents<SRGBA<T>>(components));
</span><span class="cx">     case ColorSpace::XYZ_D50:
</span><span class="cx">         return std::invoke(std::forward<Functor>(functor), makeFromComponents<XYZA<T, WhitePoint::D50>>(components));
</span><ins>+    case ColorSpace::XYZ_D65:
+        return std::invoke(std::forward<Functor>(functor), makeFromComponents<XYZA<T, WhitePoint::D65>>(components));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -104,7 +108,8 @@
</span><span class="cx">         WebCore::ColorSpace::ProPhotoRGB,
</span><span class="cx">         WebCore::ColorSpace::Rec2020,
</span><span class="cx">         WebCore::ColorSpace::SRGB,
</span><del>-        WebCore::ColorSpace::XYZ_D50
</del><ins>+        WebCore::ColorSpace::XYZ_D50,
+        WebCore::ColorSpace::XYZ_D65
</ins><span class="cx">     >;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp    2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp       2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto sourceCGColorSpace = CGColorGetColorSpace(color);
</span><span class="cx"> #if HAVE(CORE_GRAPHICS_XYZ_COLOR_SPACE)
</span><del>-    auto destinationCGColorSpace = xyzColorSpaceRef();
</del><ins>+    auto destinationCGColorSpace = xyzD50ColorSpaceRef();
</ins><span class="cx">     auto destinationColorSpace = ColorSpace::XYZ_D50;
</span><span class="cx"> #else
</span><span class="cx">     auto destinationCGColorSpace = sRGBColorSpaceRef();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorSpaceCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.cpp (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.cpp       2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.cpp  2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -102,10 +102,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(CORE_GRAPHICS_XYZ_COLOR_SPACE)
</span><del>-CGColorSpaceRef xyzColorSpaceRef()
</del><ins>+CGColorSpaceRef xyzD50ColorSpaceRef()
</ins><span class="cx"> {
</span><span class="cx">     return namedColorSpace<kCGColorSpaceGenericXYZ>();
</span><span class="cx"> }
</span><ins>+
+// FIXME: Figure out how to create a CoreGraphics XYZ-D65 color space and add a xyzD65ColorSpaceRef().
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> std::optional<ColorSpace> colorSpaceForCGColorSpace(CGColorSpaceRef colorSpace)
</span><span class="lines">@@ -123,8 +126,6 @@
</span><span class="cx">         return ColorSpace::DisplayP3;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // FIXME: labColorSpaceRef() not implemented.
-
</del><span class="cx"> #if HAVE(CORE_GRAPHICS_LINEAR_SRGB_COLOR_SPACE)
</span><span class="cx">     if (CGColorSpaceEqualToColorSpace(colorSpace, linearSRGBColorSpaceRef()))
</span><span class="cx">         return ColorSpace::LinearSRGB;
</span><span class="lines">@@ -141,10 +142,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(CORE_GRAPHICS_XYZ_COLOR_SPACE)
</span><del>-    if (CGColorSpaceEqualToColorSpace(colorSpace, xyzColorSpaceRef()))
</del><ins>+    if (CGColorSpaceEqualToColorSpace(colorSpace, xyzD50ColorSpaceRef()))
</ins><span class="cx">         return ColorSpace::XYZ_D50;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    // FIXME: Add support for ColorSpace::Lab ColorSpace::XYZ_D65 to support more direct conversions.
+
</ins><span class="cx">     return std::nullopt;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorSpaceCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h (286167 => 286168)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h 2021-11-25 13:22:42 UTC (rev 286167)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h    2021-11-25 15:24:49 UTC (rev 286168)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(CORE_GRAPHICS_XYZ_COLOR_SPACE)
</span><del>-WEBCORE_EXPORT CGColorSpaceRef xyzColorSpaceRef();
</del><ins>+WEBCORE_EXPORT CGColorSpaceRef xyzD50ColorSpaceRef();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> std::optional<ColorSpace> colorSpaceForCGColorSpace(CGColorSpaceRef);
</span><span class="lines">@@ -115,10 +115,15 @@
</span><span class="cx">         return sRGBColorSpaceRef();
</span><span class="cx">     case ColorSpace::XYZ_D50:
</span><span class="cx"> #if HAVE(CORE_GRAPHICS_XYZ_COLOR_SPACE)
</span><del>-        return xyzColorSpaceRef();
</del><ins>+        return xyzD50ColorSpaceRef();
</ins><span class="cx"> #else
</span><span class="cx">         return nullptr;
</span><span class="cx"> #endif
</span><ins>+    case ColorSpace::XYZ_D65:
+        // FIXME: Add support for this once we have figured out how to create the CoreGraphics representation.
+        return nullptr;
+
+
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return nullptr;
</span></span></pre>
</div>
</div>

</body>
</html>