haikuwebkit/LayoutTests/fast/css/parsing-lab-colors.html

96 lines
4.6 KiB
HTML
Raw Permalink Normal View History

LayoutTests/imported/w3c: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Update tests to use rectangles rather than text to make anti-aliasing differences not cause failures. These changes will be upstreamed to the WebPlatformTests. * web-platform-tests/css/css-color/lab-001-expected.html: * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002-expected.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003-expected.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lch-001-expected.html: * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002-expected.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003-expected.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: Source/WebCore: Support lab(), lch() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. This adds parsing support for lab(), lch() and color(lab ...) CSS colors (https://www.w3.org/TR/css-color-4/) and color type, conversion, and serialization support for Lab and color type and conversion support for LCH (we store these color canonically as Lab<float>, so serialization of LCH is never needed, much like HSL). This change does not add support for the host platform layer (e.g. CoreGraphics, etc) understanding of the Lab colorspace, and as such, when creating host color objects (for instance via the cachedCGColor() helper) Lab<float> colors are converted to sRGB first and then the host color is made. The ramification of this is for platforms that use backingstores with greater than sRGB gamuts, Lab colors will be clampted to sRGB. This should be rectified in a follow up change that adds proper creation of these host objects but is being left off the initial change to limit changes. Some of the imported tests have been updated to use rectangles rather than text to avoid anti-aliasing issues and will be upstreamed to WPT following landing. Tests: fast/css/parsing-lab-colors.html imported/w3c/web-platform-tests/css/css-color/lab-001.html imported/w3c/web-platform-tests/css/css-color/lab-002.html imported/w3c/web-platform-tests/css/css-color/lab-003.html imported/w3c/web-platform-tests/css/css-color/lab-004.html imported/w3c/web-platform-tests/css/css-color/lab-005.html imported/w3c/web-platform-tests/css/css-color/lab-006.html imported/w3c/web-platform-tests/css/css-color/lab-007.html imported/w3c/web-platform-tests/css/css-color/lch-001.html imported/w3c/web-platform-tests/css/css-color/lch-002.html imported/w3c/web-platform-tests/css/css-color/lch-003.html imported/w3c/web-platform-tests/css/css-color/lch-004.html imported/w3c/web-platform-tests/css/css-color/lch-005.html imported/w3c/web-platform-tests/css/css-color/lch-006.html imported/w3c/web-platform-tests/css/css-color/lch-007.html * css/CSSValueKeywords.in: Add "lab" and "lch" keywords. * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseOptionalAlpha): (WebCore::CSSPropertyParserHelpers::parseLabParameters): (WebCore::CSSPropertyParserHelpers::parseLCHParameters): (WebCore::CSSPropertyParserHelpers::parseGrayParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): Add support for parsing "lab(...)", "lch(...)", "gray(...)" and "color(lab ...)", all of which create Lab<float> colors. Also adds explicit UnitlessZeroQuirk flag to angle parsing to allow parsing of newer specs that don't want to allow unitless zero for angles. For now, I have left FIXMEs for the properties that should probably disable it. This was not strictly necessary for this change (as lch actaully allows unitless angles now), but it seems like a solid move forward. * platform/graphics/Color.h: (WebCore::Color::Color): Add overload of the Color constructor that takes a Lab<float> matching other ColorSpace types. * platform/graphics/ColorConversion.cpp: (WebCore::convertFromD50WhitePointToD65WhitePoint): (WebCore::convertFromD65WhitePointToD50WhitePoint): (WebCore::toXYZA): (WebCore::toLab): (WebCore::toLCHA): * platform/graphics/ColorConversion.h: (WebCore::toLab): (WebCore::toLCHA): Add conversions to/from Lab to D65 white point XYZA (the white point we expect XYZA to be in), and conversion from Lch to/from Lab. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Add serialization for Lab colors. We currently always serialize using the lab() notation, which appears to be correct for at least colors declared using lab(), lch() and gray(). Unclear if it is correct for colors declared with color(lab ...). Opened https://github.com/w3c/csswg-drafts/issues/5825 to track getting a resolution for "color(lab ...)". * platform/graphics/ColorSpace.cpp: (WebCore::operator<<): * platform/graphics/ColorSpace.h: Add Lab as a ColorSpace and text stream dumping for it. * platform/graphics/ColorTypes.h: (WebCore::Lab::Lab): (WebCore::asColorComponents): (WebCore::asLab): Add Lab color type. (WebCore::LCHA::LCHA): (WebCore::asLCHA): Add LCHA color type. (WebCore::callWithColorType): Add Lab to callWithColorType since it is now a valid ColorSpace. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::labColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedCGColorSpace): For now, return the sRGB color space to indicate to callers that they should do a conversion. LayoutTests: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. Parsing tests for lab/lch/gray colors. * TestExpectations: Unskip lab/lch tests. * fast/css/parsing-lab-colors-expected.txt: Added. * fast/css/parsing-lab-colors.html: Added. Canonical link: https://commits.webkit.org/232927@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 16:56:58 +00:00
<html>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Test the parsing of lab(...) and lch(...) colors.");
LayoutTests/imported/w3c: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Update tests to use rectangles rather than text to make anti-aliasing differences not cause failures. These changes will be upstreamed to the WebPlatformTests. * web-platform-tests/css/css-color/lab-001-expected.html: * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002-expected.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003-expected.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lch-001-expected.html: * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002-expected.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003-expected.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: Source/WebCore: Support lab(), lch() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. This adds parsing support for lab(), lch() and color(lab ...) CSS colors (https://www.w3.org/TR/css-color-4/) and color type, conversion, and serialization support for Lab and color type and conversion support for LCH (we store these color canonically as Lab<float>, so serialization of LCH is never needed, much like HSL). This change does not add support for the host platform layer (e.g. CoreGraphics, etc) understanding of the Lab colorspace, and as such, when creating host color objects (for instance via the cachedCGColor() helper) Lab<float> colors are converted to sRGB first and then the host color is made. The ramification of this is for platforms that use backingstores with greater than sRGB gamuts, Lab colors will be clampted to sRGB. This should be rectified in a follow up change that adds proper creation of these host objects but is being left off the initial change to limit changes. Some of the imported tests have been updated to use rectangles rather than text to avoid anti-aliasing issues and will be upstreamed to WPT following landing. Tests: fast/css/parsing-lab-colors.html imported/w3c/web-platform-tests/css/css-color/lab-001.html imported/w3c/web-platform-tests/css/css-color/lab-002.html imported/w3c/web-platform-tests/css/css-color/lab-003.html imported/w3c/web-platform-tests/css/css-color/lab-004.html imported/w3c/web-platform-tests/css/css-color/lab-005.html imported/w3c/web-platform-tests/css/css-color/lab-006.html imported/w3c/web-platform-tests/css/css-color/lab-007.html imported/w3c/web-platform-tests/css/css-color/lch-001.html imported/w3c/web-platform-tests/css/css-color/lch-002.html imported/w3c/web-platform-tests/css/css-color/lch-003.html imported/w3c/web-platform-tests/css/css-color/lch-004.html imported/w3c/web-platform-tests/css/css-color/lch-005.html imported/w3c/web-platform-tests/css/css-color/lch-006.html imported/w3c/web-platform-tests/css/css-color/lch-007.html * css/CSSValueKeywords.in: Add "lab" and "lch" keywords. * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseOptionalAlpha): (WebCore::CSSPropertyParserHelpers::parseLabParameters): (WebCore::CSSPropertyParserHelpers::parseLCHParameters): (WebCore::CSSPropertyParserHelpers::parseGrayParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): Add support for parsing "lab(...)", "lch(...)", "gray(...)" and "color(lab ...)", all of which create Lab<float> colors. Also adds explicit UnitlessZeroQuirk flag to angle parsing to allow parsing of newer specs that don't want to allow unitless zero for angles. For now, I have left FIXMEs for the properties that should probably disable it. This was not strictly necessary for this change (as lch actaully allows unitless angles now), but it seems like a solid move forward. * platform/graphics/Color.h: (WebCore::Color::Color): Add overload of the Color constructor that takes a Lab<float> matching other ColorSpace types. * platform/graphics/ColorConversion.cpp: (WebCore::convertFromD50WhitePointToD65WhitePoint): (WebCore::convertFromD65WhitePointToD50WhitePoint): (WebCore::toXYZA): (WebCore::toLab): (WebCore::toLCHA): * platform/graphics/ColorConversion.h: (WebCore::toLab): (WebCore::toLCHA): Add conversions to/from Lab to D65 white point XYZA (the white point we expect XYZA to be in), and conversion from Lch to/from Lab. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Add serialization for Lab colors. We currently always serialize using the lab() notation, which appears to be correct for at least colors declared using lab(), lch() and gray(). Unclear if it is correct for colors declared with color(lab ...). Opened https://github.com/w3c/csswg-drafts/issues/5825 to track getting a resolution for "color(lab ...)". * platform/graphics/ColorSpace.cpp: (WebCore::operator<<): * platform/graphics/ColorSpace.h: Add Lab as a ColorSpace and text stream dumping for it. * platform/graphics/ColorTypes.h: (WebCore::Lab::Lab): (WebCore::asColorComponents): (WebCore::asLab): Add Lab color type. (WebCore::LCHA::LCHA): (WebCore::asLCHA): Add LCHA color type. (WebCore::callWithColorType): Add Lab to callWithColorType since it is now a valid ColorSpace. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::labColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedCGColorSpace): For now, return the sRGB color space to indicate to callers that they should do a conversion. LayoutTests: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. Parsing tests for lab/lch/gray colors. * TestExpectations: Unskip lab/lch tests. * fast/css/parsing-lab-colors-expected.txt: Added. * fast/css/parsing-lab-colors.html: Added. Canonical link: https://commits.webkit.org/232927@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 16:56:58 +00:00
function computedStyle(property, value)
{
var div = document.createElement("div");
document.body.appendChild(div);
div.style.setProperty(property, value);
var computedValue = getComputedStyle(div).getPropertyValue(property);
document.body.removeChild(div);
return computedValue;
}
function innerStyle(property, value)
{
var div = document.createElement("div");
div.style.setProperty(property, value);
return div.style.getPropertyValue(property);
}
function testComputed(property, value, expected)
{
shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
}
function testInner(property, value, expected)
{
if (expected === null)
expected = "";
shouldBeEqualToString('innerStyle("' + property + '", "' + value + '")', expected);
}
debug('lab()');
testComputed("background-color", "lab(0% 0 0)", "lab(0% 0 0)");
testComputed("background-color", "lab(0% 0 0 / 1)", "lab(0% 0 0)");
testComputed("background-color", "lab(0% 0 0 / 0.5)", "lab(0% 0 0 / 0.5)");
testComputed("background-color", "lab(20% 0 10/0.5)", "lab(20% 0 10 / 0.5)");
testComputed("background-color", "lab(20% 0 10/50%)", "lab(20% 0 10 / 0.5)");
testComputed("background-color", "lab(400% 0 10/50%)", "lab(400% 0 10 / 0.5)");
testComputed("background-color", "lab(50% -160 160)", "lab(50% -160 160)");
testComputed("background-color", "lab(50% -200 200)", "lab(50% -200 200)");
testComputed("background-color", "lab(0% 0 0 / -10%)", "lab(0% 0 0 / 0)");
testComputed("background-color", "lab(0% 0 0 / 110%)", "lab(0% 0 0)");
testComputed("background-color", "lab(0% 0 0 / 300%)", "lab(0% 0 0)");
testComputed("background-color", "lab(-40% 0 0)", "lab(0% 0 0)");
testComputed("background-color", "lab(50% -20 0)", "lab(50% -20 0)");
testComputed("background-color", "lab(50% 0 -20)", "lab(50% 0 -20)");
LayoutTests/imported/w3c: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Update tests to use rectangles rather than text to make anti-aliasing differences not cause failures. These changes will be upstreamed to the WebPlatformTests. * web-platform-tests/css/css-color/lab-001-expected.html: * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002-expected.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003-expected.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lch-001-expected.html: * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002-expected.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003-expected.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: Source/WebCore: Support lab(), lch() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. This adds parsing support for lab(), lch() and color(lab ...) CSS colors (https://www.w3.org/TR/css-color-4/) and color type, conversion, and serialization support for Lab and color type and conversion support for LCH (we store these color canonically as Lab<float>, so serialization of LCH is never needed, much like HSL). This change does not add support for the host platform layer (e.g. CoreGraphics, etc) understanding of the Lab colorspace, and as such, when creating host color objects (for instance via the cachedCGColor() helper) Lab<float> colors are converted to sRGB first and then the host color is made. The ramification of this is for platforms that use backingstores with greater than sRGB gamuts, Lab colors will be clampted to sRGB. This should be rectified in a follow up change that adds proper creation of these host objects but is being left off the initial change to limit changes. Some of the imported tests have been updated to use rectangles rather than text to avoid anti-aliasing issues and will be upstreamed to WPT following landing. Tests: fast/css/parsing-lab-colors.html imported/w3c/web-platform-tests/css/css-color/lab-001.html imported/w3c/web-platform-tests/css/css-color/lab-002.html imported/w3c/web-platform-tests/css/css-color/lab-003.html imported/w3c/web-platform-tests/css/css-color/lab-004.html imported/w3c/web-platform-tests/css/css-color/lab-005.html imported/w3c/web-platform-tests/css/css-color/lab-006.html imported/w3c/web-platform-tests/css/css-color/lab-007.html imported/w3c/web-platform-tests/css/css-color/lch-001.html imported/w3c/web-platform-tests/css/css-color/lch-002.html imported/w3c/web-platform-tests/css/css-color/lch-003.html imported/w3c/web-platform-tests/css/css-color/lch-004.html imported/w3c/web-platform-tests/css/css-color/lch-005.html imported/w3c/web-platform-tests/css/css-color/lch-006.html imported/w3c/web-platform-tests/css/css-color/lch-007.html * css/CSSValueKeywords.in: Add "lab" and "lch" keywords. * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseOptionalAlpha): (WebCore::CSSPropertyParserHelpers::parseLabParameters): (WebCore::CSSPropertyParserHelpers::parseLCHParameters): (WebCore::CSSPropertyParserHelpers::parseGrayParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): Add support for parsing "lab(...)", "lch(...)", "gray(...)" and "color(lab ...)", all of which create Lab<float> colors. Also adds explicit UnitlessZeroQuirk flag to angle parsing to allow parsing of newer specs that don't want to allow unitless zero for angles. For now, I have left FIXMEs for the properties that should probably disable it. This was not strictly necessary for this change (as lch actaully allows unitless angles now), but it seems like a solid move forward. * platform/graphics/Color.h: (WebCore::Color::Color): Add overload of the Color constructor that takes a Lab<float> matching other ColorSpace types. * platform/graphics/ColorConversion.cpp: (WebCore::convertFromD50WhitePointToD65WhitePoint): (WebCore::convertFromD65WhitePointToD50WhitePoint): (WebCore::toXYZA): (WebCore::toLab): (WebCore::toLCHA): * platform/graphics/ColorConversion.h: (WebCore::toLab): (WebCore::toLCHA): Add conversions to/from Lab to D65 white point XYZA (the white point we expect XYZA to be in), and conversion from Lch to/from Lab. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Add serialization for Lab colors. We currently always serialize using the lab() notation, which appears to be correct for at least colors declared using lab(), lch() and gray(). Unclear if it is correct for colors declared with color(lab ...). Opened https://github.com/w3c/csswg-drafts/issues/5825 to track getting a resolution for "color(lab ...)". * platform/graphics/ColorSpace.cpp: (WebCore::operator<<): * platform/graphics/ColorSpace.h: Add Lab as a ColorSpace and text stream dumping for it. * platform/graphics/ColorTypes.h: (WebCore::Lab::Lab): (WebCore::asColorComponents): (WebCore::asLab): Add Lab color type. (WebCore::LCHA::LCHA): (WebCore::asLCHA): Add LCHA color type. (WebCore::callWithColorType): Add Lab to callWithColorType since it is now a valid ColorSpace. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::labColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedCGColorSpace): For now, return the sRGB color space to indicate to callers that they should do a conversion. LayoutTests: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. Parsing tests for lab/lch/gray colors. * TestExpectations: Unskip lab/lch tests. * fast/css/parsing-lab-colors-expected.txt: Added. * fast/css/parsing-lab-colors.html: Added. Canonical link: https://commits.webkit.org/232927@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 16:56:58 +00:00
debug('');
debug('lch()');
testComputed("background-color", "lch(0% 0 0deg)", "lch(0% 0 0)");
testComputed("background-color", "lch(0% 0 0deg / 1)", "lch(0% 0 0)");
testComputed("background-color", "lch(0% 0 0deg / 0.5)", "lch(0% 0 0 / 0.5)");
testComputed("background-color", "lch(100% 230 0deg / 0.5)", "lch(100% 230 0 / 0.5)");
testComputed("background-color", "lch(20% 50 20deg/0.5)", "lch(20% 50 20 / 0.5)");
testComputed("background-color", "lch(20% 50 20deg/50%)", "lch(20% 50 20 / 0.5)");
testComputed("background-color", "lch(10% 20 20deg / -10%)", "lch(10% 20 20 / 0)");
testComputed("background-color", "lch(10% 20 20deg / 110%)", "lch(10% 20 20)");
testComputed("background-color", "lch(10% 20 1.28rad)", "lch(10% 20 73.3386)");
testComputed("background-color", "lch(10% 20 380deg)", "lch(10% 20 20)");
testComputed("background-color", "lch(10% 20 -340deg)", "lch(10% 20 20)");
testComputed("background-color", "lch(10% 20 740deg)", "lch(10% 20 20)");
testComputed("background-color", "lch(10% 20 -700deg)", "lch(10% 20 20)");
testComputed("background-color", "lch(-40% 0 0)", "lch(0% 0 0)");
testComputed("background-color", "lch(20% -20 0)", "lch(20% 0 0)");
LayoutTests/imported/w3c: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Update tests to use rectangles rather than text to make anti-aliasing differences not cause failures. These changes will be upstreamed to the WebPlatformTests. * web-platform-tests/css/css-color/lab-001-expected.html: * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002-expected.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003-expected.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lch-001-expected.html: * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002-expected.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003-expected.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: Source/WebCore: Support lab(), lch() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. This adds parsing support for lab(), lch() and color(lab ...) CSS colors (https://www.w3.org/TR/css-color-4/) and color type, conversion, and serialization support for Lab and color type and conversion support for LCH (we store these color canonically as Lab<float>, so serialization of LCH is never needed, much like HSL). This change does not add support for the host platform layer (e.g. CoreGraphics, etc) understanding of the Lab colorspace, and as such, when creating host color objects (for instance via the cachedCGColor() helper) Lab<float> colors are converted to sRGB first and then the host color is made. The ramification of this is for platforms that use backingstores with greater than sRGB gamuts, Lab colors will be clampted to sRGB. This should be rectified in a follow up change that adds proper creation of these host objects but is being left off the initial change to limit changes. Some of the imported tests have been updated to use rectangles rather than text to avoid anti-aliasing issues and will be upstreamed to WPT following landing. Tests: fast/css/parsing-lab-colors.html imported/w3c/web-platform-tests/css/css-color/lab-001.html imported/w3c/web-platform-tests/css/css-color/lab-002.html imported/w3c/web-platform-tests/css/css-color/lab-003.html imported/w3c/web-platform-tests/css/css-color/lab-004.html imported/w3c/web-platform-tests/css/css-color/lab-005.html imported/w3c/web-platform-tests/css/css-color/lab-006.html imported/w3c/web-platform-tests/css/css-color/lab-007.html imported/w3c/web-platform-tests/css/css-color/lch-001.html imported/w3c/web-platform-tests/css/css-color/lch-002.html imported/w3c/web-platform-tests/css/css-color/lch-003.html imported/w3c/web-platform-tests/css/css-color/lch-004.html imported/w3c/web-platform-tests/css/css-color/lch-005.html imported/w3c/web-platform-tests/css/css-color/lch-006.html imported/w3c/web-platform-tests/css/css-color/lch-007.html * css/CSSValueKeywords.in: Add "lab" and "lch" keywords. * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseOptionalAlpha): (WebCore::CSSPropertyParserHelpers::parseLabParameters): (WebCore::CSSPropertyParserHelpers::parseLCHParameters): (WebCore::CSSPropertyParserHelpers::parseGrayParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): Add support for parsing "lab(...)", "lch(...)", "gray(...)" and "color(lab ...)", all of which create Lab<float> colors. Also adds explicit UnitlessZeroQuirk flag to angle parsing to allow parsing of newer specs that don't want to allow unitless zero for angles. For now, I have left FIXMEs for the properties that should probably disable it. This was not strictly necessary for this change (as lch actaully allows unitless angles now), but it seems like a solid move forward. * platform/graphics/Color.h: (WebCore::Color::Color): Add overload of the Color constructor that takes a Lab<float> matching other ColorSpace types. * platform/graphics/ColorConversion.cpp: (WebCore::convertFromD50WhitePointToD65WhitePoint): (WebCore::convertFromD65WhitePointToD50WhitePoint): (WebCore::toXYZA): (WebCore::toLab): (WebCore::toLCHA): * platform/graphics/ColorConversion.h: (WebCore::toLab): (WebCore::toLCHA): Add conversions to/from Lab to D65 white point XYZA (the white point we expect XYZA to be in), and conversion from Lch to/from Lab. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Add serialization for Lab colors. We currently always serialize using the lab() notation, which appears to be correct for at least colors declared using lab(), lch() and gray(). Unclear if it is correct for colors declared with color(lab ...). Opened https://github.com/w3c/csswg-drafts/issues/5825 to track getting a resolution for "color(lab ...)". * platform/graphics/ColorSpace.cpp: (WebCore::operator<<): * platform/graphics/ColorSpace.h: Add Lab as a ColorSpace and text stream dumping for it. * platform/graphics/ColorTypes.h: (WebCore::Lab::Lab): (WebCore::asColorComponents): (WebCore::asLab): Add Lab color type. (WebCore::LCHA::LCHA): (WebCore::asLCHA): Add LCHA color type. (WebCore::callWithColorType): Add Lab to callWithColorType since it is now a valid ColorSpace. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::labColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedCGColorSpace): For now, return the sRGB color space to indicate to callers that they should do a conversion. LayoutTests: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. Parsing tests for lab/lch/gray colors. * TestExpectations: Unskip lab/lch tests. * fast/css/parsing-lab-colors-expected.txt: Added. * fast/css/parsing-lab-colors.html: Added. Canonical link: https://commits.webkit.org/232927@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 16:56:58 +00:00
// hue (the third argument) can be either an angle or number, with number interpreted as degrees.
testComputed("background-color", "lch(0% 0 0 / 0.5)", "lch(0% 0 0 / 0.5)");
testComputed("background-color", "lch(10% 20 20 / 110%)", "lch(10% 20 20)");
testComputed("background-color", "lch(10% 20 -700)", "lch(10% 20 20)");
LayoutTests/imported/w3c: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Update tests to use rectangles rather than text to make anti-aliasing differences not cause failures. These changes will be upstreamed to the WebPlatformTests. * web-platform-tests/css/css-color/lab-001-expected.html: * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002-expected.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003-expected.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lch-001-expected.html: * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002-expected.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003-expected.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: Source/WebCore: Support lab(), lch() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. This adds parsing support for lab(), lch() and color(lab ...) CSS colors (https://www.w3.org/TR/css-color-4/) and color type, conversion, and serialization support for Lab and color type and conversion support for LCH (we store these color canonically as Lab<float>, so serialization of LCH is never needed, much like HSL). This change does not add support for the host platform layer (e.g. CoreGraphics, etc) understanding of the Lab colorspace, and as such, when creating host color objects (for instance via the cachedCGColor() helper) Lab<float> colors are converted to sRGB first and then the host color is made. The ramification of this is for platforms that use backingstores with greater than sRGB gamuts, Lab colors will be clampted to sRGB. This should be rectified in a follow up change that adds proper creation of these host objects but is being left off the initial change to limit changes. Some of the imported tests have been updated to use rectangles rather than text to avoid anti-aliasing issues and will be upstreamed to WPT following landing. Tests: fast/css/parsing-lab-colors.html imported/w3c/web-platform-tests/css/css-color/lab-001.html imported/w3c/web-platform-tests/css/css-color/lab-002.html imported/w3c/web-platform-tests/css/css-color/lab-003.html imported/w3c/web-platform-tests/css/css-color/lab-004.html imported/w3c/web-platform-tests/css/css-color/lab-005.html imported/w3c/web-platform-tests/css/css-color/lab-006.html imported/w3c/web-platform-tests/css/css-color/lab-007.html imported/w3c/web-platform-tests/css/css-color/lch-001.html imported/w3c/web-platform-tests/css/css-color/lch-002.html imported/w3c/web-platform-tests/css/css-color/lch-003.html imported/w3c/web-platform-tests/css/css-color/lch-004.html imported/w3c/web-platform-tests/css/css-color/lch-005.html imported/w3c/web-platform-tests/css/css-color/lch-006.html imported/w3c/web-platform-tests/css/css-color/lch-007.html * css/CSSValueKeywords.in: Add "lab" and "lch" keywords. * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseOptionalAlpha): (WebCore::CSSPropertyParserHelpers::parseLabParameters): (WebCore::CSSPropertyParserHelpers::parseLCHParameters): (WebCore::CSSPropertyParserHelpers::parseGrayParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): Add support for parsing "lab(...)", "lch(...)", "gray(...)" and "color(lab ...)", all of which create Lab<float> colors. Also adds explicit UnitlessZeroQuirk flag to angle parsing to allow parsing of newer specs that don't want to allow unitless zero for angles. For now, I have left FIXMEs for the properties that should probably disable it. This was not strictly necessary for this change (as lch actaully allows unitless angles now), but it seems like a solid move forward. * platform/graphics/Color.h: (WebCore::Color::Color): Add overload of the Color constructor that takes a Lab<float> matching other ColorSpace types. * platform/graphics/ColorConversion.cpp: (WebCore::convertFromD50WhitePointToD65WhitePoint): (WebCore::convertFromD65WhitePointToD50WhitePoint): (WebCore::toXYZA): (WebCore::toLab): (WebCore::toLCHA): * platform/graphics/ColorConversion.h: (WebCore::toLab): (WebCore::toLCHA): Add conversions to/from Lab to D65 white point XYZA (the white point we expect XYZA to be in), and conversion from Lch to/from Lab. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Add serialization for Lab colors. We currently always serialize using the lab() notation, which appears to be correct for at least colors declared using lab(), lch() and gray(). Unclear if it is correct for colors declared with color(lab ...). Opened https://github.com/w3c/csswg-drafts/issues/5825 to track getting a resolution for "color(lab ...)". * platform/graphics/ColorSpace.cpp: (WebCore::operator<<): * platform/graphics/ColorSpace.h: Add Lab as a ColorSpace and text stream dumping for it. * platform/graphics/ColorTypes.h: (WebCore::Lab::Lab): (WebCore::asColorComponents): (WebCore::asLab): Add Lab color type. (WebCore::LCHA::LCHA): (WebCore::asLCHA): Add LCHA color type. (WebCore::callWithColorType): Add Lab to callWithColorType since it is now a valid ColorSpace. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::labColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedCGColorSpace): For now, return the sRGB color space to indicate to callers that they should do a conversion. LayoutTests: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. Parsing tests for lab/lch/gray colors. * TestExpectations: Unskip lab/lch tests. * fast/css/parsing-lab-colors-expected.txt: Added. * fast/css/parsing-lab-colors.html: Added. Canonical link: https://commits.webkit.org/232927@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 16:56:58 +00:00
debug('');
debug('Test invalid values');
testComputed("background-color", "lab(0 0 0)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lab(0% 0% 0)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lab(0% 0 0 1)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lab(0% 0 0 10%)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lab(0% 0 0deg)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lab(0% 0% 0deg)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lab(40% 0 0deg)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lch(0 0 0 / 0.5)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lch(20% 10 10deg 10)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "lch(20% 10 10deg 10 / 0.5)", "rgba(0, 0, 0, 0)");
testComputed("background-color", "color(lab 20% 0 10 / 50%)", "rgba(0, 0, 0, 0)");
LayoutTests/imported/w3c: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Update tests to use rectangles rather than text to make anti-aliasing differences not cause failures. These changes will be upstreamed to the WebPlatformTests. * web-platform-tests/css/css-color/lab-001-expected.html: * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002-expected.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003-expected.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lch-001-expected.html: * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002-expected.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003-expected.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: Source/WebCore: Support lab(), lch() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. This adds parsing support for lab(), lch() and color(lab ...) CSS colors (https://www.w3.org/TR/css-color-4/) and color type, conversion, and serialization support for Lab and color type and conversion support for LCH (we store these color canonically as Lab<float>, so serialization of LCH is never needed, much like HSL). This change does not add support for the host platform layer (e.g. CoreGraphics, etc) understanding of the Lab colorspace, and as such, when creating host color objects (for instance via the cachedCGColor() helper) Lab<float> colors are converted to sRGB first and then the host color is made. The ramification of this is for platforms that use backingstores with greater than sRGB gamuts, Lab colors will be clampted to sRGB. This should be rectified in a follow up change that adds proper creation of these host objects but is being left off the initial change to limit changes. Some of the imported tests have been updated to use rectangles rather than text to avoid anti-aliasing issues and will be upstreamed to WPT following landing. Tests: fast/css/parsing-lab-colors.html imported/w3c/web-platform-tests/css/css-color/lab-001.html imported/w3c/web-platform-tests/css/css-color/lab-002.html imported/w3c/web-platform-tests/css/css-color/lab-003.html imported/w3c/web-platform-tests/css/css-color/lab-004.html imported/w3c/web-platform-tests/css/css-color/lab-005.html imported/w3c/web-platform-tests/css/css-color/lab-006.html imported/w3c/web-platform-tests/css/css-color/lab-007.html imported/w3c/web-platform-tests/css/css-color/lch-001.html imported/w3c/web-platform-tests/css/css-color/lch-002.html imported/w3c/web-platform-tests/css/css-color/lch-003.html imported/w3c/web-platform-tests/css/css-color/lch-004.html imported/w3c/web-platform-tests/css/css-color/lch-005.html imported/w3c/web-platform-tests/css/css-color/lch-006.html imported/w3c/web-platform-tests/css/css-color/lch-007.html * css/CSSValueKeywords.in: Add "lab" and "lch" keywords. * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseOptionalAlpha): (WebCore::CSSPropertyParserHelpers::parseLabParameters): (WebCore::CSSPropertyParserHelpers::parseLCHParameters): (WebCore::CSSPropertyParserHelpers::parseGrayParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): Add support for parsing "lab(...)", "lch(...)", "gray(...)" and "color(lab ...)", all of which create Lab<float> colors. Also adds explicit UnitlessZeroQuirk flag to angle parsing to allow parsing of newer specs that don't want to allow unitless zero for angles. For now, I have left FIXMEs for the properties that should probably disable it. This was not strictly necessary for this change (as lch actaully allows unitless angles now), but it seems like a solid move forward. * platform/graphics/Color.h: (WebCore::Color::Color): Add overload of the Color constructor that takes a Lab<float> matching other ColorSpace types. * platform/graphics/ColorConversion.cpp: (WebCore::convertFromD50WhitePointToD65WhitePoint): (WebCore::convertFromD65WhitePointToD50WhitePoint): (WebCore::toXYZA): (WebCore::toLab): (WebCore::toLCHA): * platform/graphics/ColorConversion.h: (WebCore::toLab): (WebCore::toLCHA): Add conversions to/from Lab to D65 white point XYZA (the white point we expect XYZA to be in), and conversion from Lch to/from Lab. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Add serialization for Lab colors. We currently always serialize using the lab() notation, which appears to be correct for at least colors declared using lab(), lch() and gray(). Unclear if it is correct for colors declared with color(lab ...). Opened https://github.com/w3c/csswg-drafts/issues/5825 to track getting a resolution for "color(lab ...)". * platform/graphics/ColorSpace.cpp: (WebCore::operator<<): * platform/graphics/ColorSpace.h: Add Lab as a ColorSpace and text stream dumping for it. * platform/graphics/ColorTypes.h: (WebCore::Lab::Lab): (WebCore::asColorComponents): (WebCore::asLab): Add Lab color type. (WebCore::LCHA::LCHA): (WebCore::asLCHA): Add LCHA color type. (WebCore::callWithColorType): Add Lab to callWithColorType since it is now a valid ColorSpace. * platform/graphics/cg/ColorSpaceCG.cpp: (WebCore::labColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: (WebCore::cachedCGColorSpace): For now, return the sRGB color space to indicate to callers that they should do a conversion. LayoutTests: Support lab(), lch(), gray() and color(lab ...) colors https://bugs.webkit.org/show_bug.cgi?id=205675 Reviewed by Simon Fraser. Original patch by Simon Fraser. Parsing tests for lab/lch/gray colors. * TestExpectations: Unskip lab/lch tests. * fast/css/parsing-lab-colors-expected.txt: Added. * fast/css/parsing-lab-colors.html: Added. Canonical link: https://commits.webkit.org/232927@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 16:56:58 +00:00
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>