Changeset 287838 in webkit


Ignore:
Timestamp:
Jan 10, 2022 9:39:32 AM (6 months ago)
Author:
weinig@apple.com
Message:

[CSS Color 4] CSS color() function should not clamp channels to the 0-1 range
https://bugs.webkit.org/show_bug.cgi?id=234697

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update tests to include out of gamut examples for RGB types as well as some outside
allowed values for lab/lch/oklab/oklch types (in the latter we clamp as the spec requires.).

  • web-platform-tests/css/css-color/color-function-parsing-expected.txt:
  • web-platform-tests/css/css-color/color-function-parsing.html:
  • web-platform-tests/css/css-color/parsing/color-computed-expected.txt:
  • web-platform-tests/css/css-color/parsing/color-computed.html:
  • web-platform-tests/css/css-color/parsing/color-mix-computed-expected.txt:
  • web-platform-tests/css/css-color/parsing/color-mix-computed.html:
  • web-platform-tests/css/css-color/parsing/color-mix-valid-expected.txt:
  • web-platform-tests/css/css-color/parsing/color-mix-valid.html:
  • web-platform-tests/css/css-color/parsing/color-valid-expected.txt:
  • web-platform-tests/css/css-color/parsing/color-valid.html:
  • web-platform-tests/css/css-color/parsing/relative-color-computed-expected.txt:
  • web-platform-tests/css/css-color/parsing/relative-color-computed.html:
  • web-platform-tests/css/css-color/parsing/relative-color-valid-expected.txt:
  • web-platform-tests/css/css-color/parsing/relative-color-valid.html:

Source/WebCore:

Allow components outside the the 0-1 range for RGB color function types (e.g. color(srgb -2 15 100)).

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::parseColorFunctionForRGBTypes):
Remove clamping when parsing RGB color function types (we still clamp for legacy rgb()/rgba() as specified).

(WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionParameters):
(WebCore::CSSPropertyParserHelpers::parseNonRelativeColorFunctionParameters):
Switch mapping of RGB color function types to their extended counterparts which allow the extended range.

  • platform/graphics/ColorInterpolationMethod.h:

Switch the RGB interpolation color types to the extended counterparts as well to allow out of gamut mixing.

LayoutTests:

Update tests to include out of gamut examples for RGB types as well as some outside
allowed values for lab/lch/oklab/oklch types (in the latter we clamp as the spec requires.).

  • css3/color/color-function-computed-style-expected.txt:
  • css3/color/color-function-computed-style.html:
  • css3/color/color-function-parsing-expected.txt:
  • css3/color/color-function-parsing.html:
  • fast/css/parsing-color-function-expected.txt:
  • fast/css/parsing-color-function.html:
Location:
trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r287836 r287838  
     12022-01-10  Sam Weinig  <weinig@apple.com>
     2
     3        [CSS Color 4] CSS color() function should not clamp channels to the 0-1 range
     4        https://bugs.webkit.org/show_bug.cgi?id=234697
     5
     6        Reviewed by Darin Adler.
     7
     8        Update tests to include out of gamut examples for RGB types as well as some outside
     9        allowed values for lab/lch/oklab/oklch types (in the latter we clamp as the spec requires.).
     10
     11        * css3/color/color-function-computed-style-expected.txt:
     12        * css3/color/color-function-computed-style.html:
     13        * css3/color/color-function-parsing-expected.txt:
     14        * css3/color/color-function-parsing.html:
     15        * fast/css/parsing-color-function-expected.txt:
     16        * fast/css/parsing-color-function.html:
     17
    1182022-01-10  Arcady Goldmints-Orlov  <agoldmints@igalia.com>
    219
  • trunk/LayoutTests/css3/color/color-function-computed-style-expected.txt

    r208116 r287838  
    5858
    5959
    60 TEST: sRGB color with negative component should clamp to 0 --> color(srgb -0.25 0.5 0.75)
    61 PASS declaration.getPropertyValue('color') is 'color(srgb 0 0.5 0.75)'
     60TEST: sRGB color with negative component should not clamp to 0 --> color(srgb -0.25 0.5 0.75)
     61PASS declaration.getPropertyValue('color') is 'color(srgb -0.25 0.5 0.75)'
    6262
    63 TEST: sRGB color with component > 1 should clamp --> color(srgb 0.25 1.5 0.75)
    64 PASS declaration.getPropertyValue('color') is 'color(srgb 0.25 1 0.75)'
     63TEST: sRGB color with component > 1 should not clamp --> color(srgb 0.25 1.5 0.75)
     64PASS declaration.getPropertyValue('color') is 'color(srgb 0.25 1.5 0.75)'
    6565
    66 TEST: Display P3 color with negative component should clamp to 0 --> color(display-p3 0.5 -199 0.75)
    67 PASS declaration.getPropertyValue('color') is 'color(display-p3 0.5 0 0.75)'
     66TEST: Display P3 color with negative component should not clamp to 0 --> color(display-p3 0.5 -199 0.75)
     67PASS declaration.getPropertyValue('color') is 'color(display-p3 0.5 -199 0.75)'
    6868
    69 TEST: Display P3 color with component > 1 should clamp --> color(display-p3 184 1.00001 2347329746587)
    70 PASS declaration.getPropertyValue('color') is 'color(display-p3 1 1 1)'
     69TEST: Display P3 color with component > 1 should not clamp --> color(display-p3 184 1.00001 2347329746587)
     70PASS declaration.getPropertyValue('color') is 'color(display-p3 184 1.00001 2347329700000)'
    7171
    7272TEST: Alpha > 1 should clamp --> color(srgb 0.1 0.2 0.3 / 1.9)
  • trunk/LayoutTests/css3/color/color-function-computed-style.html

    r208116 r287838  
    5454debug("");
    5555
    56 // NOTE: If we start supporting extended-range sRGB without changing the keyword, these
    57 // tests may fail.
    58 testColorFunction("sRGB color with negative component should clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb 0 0.5 0.75)");
    59 testColorFunction("sRGB color with component > 1 should clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1 0.75)");
     56testColorFunction("sRGB color with negative component should not clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb -0.25 0.5 0.75)");
     57testColorFunction("sRGB color with component > 1 should not clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1.5 0.75)");
    6058
    61 testColorFunction("Display P3 color with negative component should clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 0 0.75)");
    62 testColorFunction("Display P3 color with component > 1 should clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 1 1 1)");
     59testColorFunction("Display P3 color with negative component should not clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 -199 0.75)");
     60testColorFunction("Display P3 color with component > 1 should not clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 184 1.00001 2347329700000)");
    6361
    6462testColorFunction("Alpha > 1 should clamp", "color(srgb 0.1 0.2 0.3 / 1.9)", "color(srgb 0.1 0.2 0.3)");
  • trunk/LayoutTests/css3/color/color-function-parsing-expected.txt

    r208116 r287838  
    5858
    5959
    60 TEST: sRGB color with negative component should clamp to 0 --> color(srgb -0.25 0.5 0.75)
    61 PASS declaration.getPropertyValue('color') is 'color(srgb 0 0.5 0.75)'
     60TEST: sRGB color with negative component should not clamp to 0 --> color(srgb -0.25 0.5 0.75)
     61PASS declaration.getPropertyValue('color') is 'color(srgb -0.25 0.5 0.75)'
    6262
    63 TEST: sRGB color with component > 1 should clamp --> color(srgb 0.25 1.5 0.75)
    64 PASS declaration.getPropertyValue('color') is 'color(srgb 0.25 1 0.75)'
     63TEST: sRGB color with component > 1 should not clamp --> color(srgb 0.25 1.5 0.75)
     64PASS declaration.getPropertyValue('color') is 'color(srgb 0.25 1.5 0.75)'
    6565
    66 TEST: Display P3 color with negative component should clamp to 0 --> color(display-p3 0.5 -199 0.75)
    67 PASS declaration.getPropertyValue('color') is 'color(display-p3 0.5 0 0.75)'
     66TEST: Display P3 color with negative component should not clamp to 0 --> color(display-p3 0.5 -199 0.75)
     67PASS declaration.getPropertyValue('color') is 'color(display-p3 0.5 -199 0.75)'
    6868
    69 TEST: Display P3 color with component > 1 should clamp --> color(display-p3 184 1.00001 2347329746587)
    70 PASS declaration.getPropertyValue('color') is 'color(display-p3 1 1 1)'
     69TEST: Display P3 color with component > 1 should not clamp --> color(display-p3 184 1.00001 2347329746587)
     70PASS declaration.getPropertyValue('color') is 'color(display-p3 184 1.00001 2347329700000)'
    7171
    7272TEST: Alpha > 1 should clamp --> color(srgb 0.1 0.2 0.3 / 1.9)
  • trunk/LayoutTests/css3/color/color-function-parsing.html

    r208116 r287838  
    5353debug("");
    5454
    55 // NOTE: If we start supporting extended-range sRGB without changing the keyword, these
    56 // tests may fail.
    57 testColorFunction("sRGB color with negative component should clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb 0 0.5 0.75)");
    58 testColorFunction("sRGB color with component > 1 should clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1 0.75)");
     55testColorFunction("sRGB color with negative component should not clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb -0.25 0.5 0.75)");
     56testColorFunction("sRGB color with component > 1 should not clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1.5 0.75)");
    5957
    60 testColorFunction("Display P3 color with negative component should clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 0 0.75)");
    61 testColorFunction("Display P3 color with component > 1 should clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 1 1 1)");
     58testColorFunction("Display P3 color with negative component should not clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 -199 0.75)");
     59testColorFunction("Display P3 color with component > 1 should not clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 184 1.00001 2347329700000)");
    6260
    6361testColorFunction("Alpha > 1 should clamp", "color(srgb 0.1 0.2 0.3 / 1.9)", "color(srgb 0.1 0.2 0.3)");
  • trunk/LayoutTests/fast/css/parsing-color-function-expected.txt

    r286168 r287838  
    1111PASS computedStyle("background-color", "color(srgb 0 0 0 / 1)") is "color(srgb 0 0 0)"
    1212PASS computedStyle("background-color", "color(srgb 0% 0 0 / 0.5)") is "color(srgb 0 0 0 / 0.5)"
    13 PASS computedStyle("background-color", "color(srgb 20% 0 10/0.5)") is "color(srgb 0.2 0 1 / 0.5)"
    14 PASS computedStyle("background-color", "color(srgb 20% 0 10/50%)") is "color(srgb 0.2 0 1 / 0.5)"
    15 PASS computedStyle("background-color", "color(srgb 400% 0 10/50%)") is "color(srgb 1 0 1 / 0.5)"
    16 PASS computedStyle("background-color", "color(srgb 50% -160 160)") is "color(srgb 0.5 0 1)"
    17 PASS computedStyle("background-color", "color(srgb 50% -200 200)") is "color(srgb 0.5 0 1)"
     13PASS computedStyle("background-color", "color(srgb 20% 0 10/0.5)") is "color(srgb 0.2 0 10 / 0.5)"
     14PASS computedStyle("background-color", "color(srgb 20% 0 10/50%)") is "color(srgb 0.2 0 10 / 0.5)"
     15PASS computedStyle("background-color", "color(srgb 400% 0 10/50%)") is "color(srgb 4 0 10 / 0.5)"
     16PASS computedStyle("background-color", "color(srgb 50% -160 160)") is "color(srgb 0.5 -160 160)"
     17PASS computedStyle("background-color", "color(srgb 50% -200 200)") is "color(srgb 0.5 -200 200)"
    1818PASS computedStyle("background-color", "color(srgb 0 0 0 / -10%)") is "color(srgb 0 0 0 / 0)"
    1919PASS computedStyle("background-color", "color(srgb 0 0 0 / 110%)") is "color(srgb 0 0 0)"
    2020PASS computedStyle("background-color", "color(srgb 0 0 0 / 300%)") is "color(srgb 0 0 0)"
    21 PASS computedStyle("background-color", "color(srgb 50% -200)") is "color(srgb 0.5 0 0)"
     21PASS computedStyle("background-color", "color(srgb 50% -200)") is "color(srgb 0.5 -200 0)"
    2222PASS computedStyle("background-color", "color(srgb 50%)") is "color(srgb 0.5 0 0)"
    2323PASS computedStyle("background-color", "color(srgb)") is "color(srgb 0 0 0)"
    24 PASS computedStyle("background-color", "color(srgb 50% -200 / 0.5)") is "color(srgb 0.5 0 0 / 0.5)"
     24PASS computedStyle("background-color", "color(srgb 50% -200 / 0.5)") is "color(srgb 0.5 -200 0 / 0.5)"
    2525PASS computedStyle("background-color", "color(srgb 50% / 0.5)") is "color(srgb 0.5 0 0 / 0.5)"
    2626PASS computedStyle("background-color", "color(srgb / 0.5)") is "color(srgb 0 0 0 / 0.5)"
     
    4141PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 1)") is "color(srgb-linear 0 0 0)"
    4242PASS computedStyle("background-color", "color(srgb-linear 0% 0 0 / 0.5)") is "color(srgb-linear 0 0 0 / 0.5)"
    43 PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/0.5)") is "color(srgb-linear 0.2 0 1 / 0.5)"
    44 PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/50%)") is "color(srgb-linear 0.2 0 1 / 0.5)"
    45 PASS computedStyle("background-color", "color(srgb-linear 400% 0 10/50%)") is "color(srgb-linear 1 0 1 / 0.5)"
    46 PASS computedStyle("background-color", "color(srgb-linear 50% -160 160)") is "color(srgb-linear 0.5 0 1)"
    47 PASS computedStyle("background-color", "color(srgb-linear 50% -200 200)") is "color(srgb-linear 0.5 0 1)"
     43PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/0.5)") is "color(srgb-linear 0.2 0 10 / 0.5)"
     44PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/50%)") is "color(srgb-linear 0.2 0 10 / 0.5)"
     45PASS computedStyle("background-color", "color(srgb-linear 400% 0 10/50%)") is "color(srgb-linear 4 0 10 / 0.5)"
     46PASS computedStyle("background-color", "color(srgb-linear 50% -160 160)") is "color(srgb-linear 0.5 -160 160)"
     47PASS computedStyle("background-color", "color(srgb-linear 50% -200 200)") is "color(srgb-linear 0.5 -200 200)"
    4848PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / -10%)") is "color(srgb-linear 0 0 0 / 0)"
    4949PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 110%)") is "color(srgb-linear 0 0 0)"
    5050PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 300%)") is "color(srgb-linear 0 0 0)"
    51 PASS computedStyle("background-color", "color(srgb-linear 50% -200)") is "color(srgb-linear 0.5 0 0)"
     51PASS computedStyle("background-color", "color(srgb-linear 50% -200)") is "color(srgb-linear 0.5 -200 0)"
    5252PASS computedStyle("background-color", "color(srgb-linear 50%)") is "color(srgb-linear 0.5 0 0)"
    5353PASS computedStyle("background-color", "color(srgb-linear)") is "color(srgb-linear 0 0 0)"
    54 PASS computedStyle("background-color", "color(srgb-linear 50% -200 / 0.5)") is "color(srgb-linear 0.5 0 0 / 0.5)"
     54PASS computedStyle("background-color", "color(srgb-linear 50% -200 / 0.5)") is "color(srgb-linear 0.5 -200 0 / 0.5)"
    5555PASS computedStyle("background-color", "color(srgb-linear 50% / 0.5)") is "color(srgb-linear 0.5 0 0 / 0.5)"
    5656PASS computedStyle("background-color", "color(srgb-linear / 0.5)") is "color(srgb-linear 0 0 0 / 0.5)"
     
    7171PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / 1)") is "color(a98-rgb 0 0 0)"
    7272PASS computedStyle("background-color", "color(a98-rgb 0% 0 0 / 0.5)") is "color(a98-rgb 0 0 0 / 0.5)"
    73 PASS computedStyle("background-color", "color(a98-rgb 20% 0 10/0.5)") is "color(a98-rgb 0.2 0 1 / 0.5)"
    74 PASS computedStyle("background-color", "color(a98-rgb 20% 0 10/50%)") is "color(a98-rgb 0.2 0 1 / 0.5)"
    75 PASS computedStyle("background-color", "color(a98-rgb 400% 0 10/50%)") is "color(a98-rgb 1 0 1 / 0.5)"
    76 PASS computedStyle("background-color", "color(a98-rgb 50% -160 160)") is "color(a98-rgb 0.5 0 1)"
    77 PASS computedStyle("background-color", "color(a98-rgb 50% -200 200)") is "color(a98-rgb 0.5 0 1)"
     73PASS computedStyle("background-color", "color(a98-rgb 20% 0 10/0.5)") is "color(a98-rgb 0.2 0 10 / 0.5)"
     74PASS computedStyle("background-color", "color(a98-rgb 20% 0 10/50%)") is "color(a98-rgb 0.2 0 10 / 0.5)"
     75PASS computedStyle("background-color", "color(a98-rgb 400% 0 10/50%)") is "color(a98-rgb 4 0 10 / 0.5)"
     76PASS computedStyle("background-color", "color(a98-rgb 50% -160 160)") is "color(a98-rgb 0.5 -160 160)"
     77PASS computedStyle("background-color", "color(a98-rgb 50% -200 200)") is "color(a98-rgb 0.5 -200 200)"
    7878PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / -10%)") is "color(a98-rgb 0 0 0 / 0)"
    7979PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / 110%)") is "color(a98-rgb 0 0 0)"
    8080PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / 300%)") is "color(a98-rgb 0 0 0)"
    81 PASS computedStyle("background-color", "color(a98-rgb 50% -200)") is "color(a98-rgb 0.5 0 0)"
     81PASS computedStyle("background-color", "color(a98-rgb 50% -200)") is "color(a98-rgb 0.5 -200 0)"
    8282PASS computedStyle("background-color", "color(a98-rgb 50%)") is "color(a98-rgb 0.5 0 0)"
    8383PASS computedStyle("background-color", "color(a98-rgb)") is "color(a98-rgb 0 0 0)"
    84 PASS computedStyle("background-color", "color(a98-rgb 50% -200 / 0.5)") is "color(a98-rgb 0.5 0 0 / 0.5)"
     84PASS computedStyle("background-color", "color(a98-rgb 50% -200 / 0.5)") is "color(a98-rgb 0.5 -200 0 / 0.5)"
    8585PASS computedStyle("background-color", "color(a98-rgb 50% / 0.5)") is "color(a98-rgb 0.5 0 0 / 0.5)"
    8686PASS computedStyle("background-color", "color(a98-rgb / 0.5)") is "color(a98-rgb 0 0 0 / 0.5)"
     
    101101PASS computedStyle("background-color", "color(rec2020 0 0 0 / 1)") is "color(rec2020 0 0 0)"
    102102PASS computedStyle("background-color", "color(rec2020 0% 0 0 / 0.5)") is "color(rec2020 0 0 0 / 0.5)"
    103 PASS computedStyle("background-color", "color(rec2020 20% 0 10/0.5)") is "color(rec2020 0.2 0 1 / 0.5)"
    104 PASS computedStyle("background-color", "color(rec2020 20% 0 10/50%)") is "color(rec2020 0.2 0 1 / 0.5)"
    105 PASS computedStyle("background-color", "color(rec2020 400% 0 10/50%)") is "color(rec2020 1 0 1 / 0.5)"
    106 PASS computedStyle("background-color", "color(rec2020 50% -160 160)") is "color(rec2020 0.5 0 1)"
    107 PASS computedStyle("background-color", "color(rec2020 50% -200 200)") is "color(rec2020 0.5 0 1)"
     103PASS computedStyle("background-color", "color(rec2020 20% 0 10/0.5)") is "color(rec2020 0.2 0 10 / 0.5)"
     104PASS computedStyle("background-color", "color(rec2020 20% 0 10/50%)") is "color(rec2020 0.2 0 10 / 0.5)"
     105PASS computedStyle("background-color", "color(rec2020 400% 0 10/50%)") is "color(rec2020 4 0 10 / 0.5)"
     106PASS computedStyle("background-color", "color(rec2020 50% -160 160)") is "color(rec2020 0.5 -160 160)"
     107PASS computedStyle("background-color", "color(rec2020 50% -200 200)") is "color(rec2020 0.5 -200 200)"
    108108PASS computedStyle("background-color", "color(rec2020 0 0 0 / -10%)") is "color(rec2020 0 0 0 / 0)"
    109109PASS computedStyle("background-color", "color(rec2020 0 0 0 / 110%)") is "color(rec2020 0 0 0)"
    110110PASS computedStyle("background-color", "color(rec2020 0 0 0 / 300%)") is "color(rec2020 0 0 0)"
    111 PASS computedStyle("background-color", "color(rec2020 50% -200)") is "color(rec2020 0.5 0 0)"
     111PASS computedStyle("background-color", "color(rec2020 50% -200)") is "color(rec2020 0.5 -200 0)"
    112112PASS computedStyle("background-color", "color(rec2020 50%)") is "color(rec2020 0.5 0 0)"
    113113PASS computedStyle("background-color", "color(rec2020)") is "color(rec2020 0 0 0)"
    114 PASS computedStyle("background-color", "color(rec2020 50% -200 / 0.5)") is "color(rec2020 0.5 0 0 / 0.5)"
     114PASS computedStyle("background-color", "color(rec2020 50% -200 / 0.5)") is "color(rec2020 0.5 -200 0 / 0.5)"
    115115PASS computedStyle("background-color", "color(rec2020 50% / 0.5)") is "color(rec2020 0.5 0 0 / 0.5)"
    116116PASS computedStyle("background-color", "color(rec2020 / 0.5)") is "color(rec2020 0 0 0 / 0.5)"
     
    131131PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / 1)") is "color(prophoto-rgb 0 0 0)"
    132132PASS computedStyle("background-color", "color(prophoto-rgb 0% 0 0 / 0.5)") is "color(prophoto-rgb 0 0 0 / 0.5)"
    133 PASS computedStyle("background-color", "color(prophoto-rgb 20% 0 10/0.5)") is "color(prophoto-rgb 0.2 0 1 / 0.5)"
    134 PASS computedStyle("background-color", "color(prophoto-rgb 20% 0 10/50%)") is "color(prophoto-rgb 0.2 0 1 / 0.5)"
    135 PASS computedStyle("background-color", "color(prophoto-rgb 400% 0 10/50%)") is "color(prophoto-rgb 1 0 1 / 0.5)"
    136 PASS computedStyle("background-color", "color(prophoto-rgb 50% -160 160)") is "color(prophoto-rgb 0.5 0 1)"
    137 PASS computedStyle("background-color", "color(prophoto-rgb 50% -200 200)") is "color(prophoto-rgb 0.5 0 1)"
     133PASS computedStyle("background-color", "color(prophoto-rgb 20% 0 10/0.5)") is "color(prophoto-rgb 0.2 0 10 / 0.5)"
     134PASS computedStyle("background-color", "color(prophoto-rgb 20% 0 10/50%)") is "color(prophoto-rgb 0.2 0 10 / 0.5)"
     135PASS computedStyle("background-color", "color(prophoto-rgb 400% 0 10/50%)") is "color(prophoto-rgb 4 0 10 / 0.5)"
     136PASS computedStyle("background-color", "color(prophoto-rgb 50% -160 160)") is "color(prophoto-rgb 0.5 -160 160)"
     137PASS computedStyle("background-color", "color(prophoto-rgb 50% -200 200)") is "color(prophoto-rgb 0.5 -200 200)"
    138138PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / -10%)") is "color(prophoto-rgb 0 0 0 / 0)"
    139139PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / 110%)") is "color(prophoto-rgb 0 0 0)"
    140140PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / 300%)") is "color(prophoto-rgb 0 0 0)"
    141 PASS computedStyle("background-color", "color(prophoto-rgb 50% -200)") is "color(prophoto-rgb 0.5 0 0)"
     141PASS computedStyle("background-color", "color(prophoto-rgb 50% -200)") is "color(prophoto-rgb 0.5 -200 0)"
    142142PASS computedStyle("background-color", "color(prophoto-rgb 50%)") is "color(prophoto-rgb 0.5 0 0)"
    143143PASS computedStyle("background-color", "color(prophoto-rgb)") is "color(prophoto-rgb 0 0 0)"
    144 PASS computedStyle("background-color", "color(prophoto-rgb 50% -200 / 0.5)") is "color(prophoto-rgb 0.5 0 0 / 0.5)"
     144PASS computedStyle("background-color", "color(prophoto-rgb 50% -200 / 0.5)") is "color(prophoto-rgb 0.5 -200 0 / 0.5)"
    145145PASS computedStyle("background-color", "color(prophoto-rgb 50% / 0.5)") is "color(prophoto-rgb 0.5 0 0 / 0.5)"
    146146PASS computedStyle("background-color", "color(prophoto-rgb / 0.5)") is "color(prophoto-rgb 0 0 0 / 0.5)"
  • trunk/LayoutTests/fast/css/parsing-color-function.html

    r286168 r287838  
    4444        testComputed("background-color", `color(${color} 0 0 0 / 1)`, `color(${color} 0 0 0)`);
    4545        testComputed("background-color", `color(${color} 0% 0 0 / 0.5)`, `color(${color} 0 0 0 / 0.5)`);
    46         testComputed("background-color", `color(${color} 20% 0 10/0.5)`, `color(${color} 0.2 0 1 / 0.5)`);
    47         testComputed("background-color", `color(${color} 20% 0 10/50%)`, `color(${color} 0.2 0 1 / 0.5)`);
    48         testComputed("background-color", `color(${color} 400% 0 10/50%)`, `color(${color} 1 0 1 / 0.5)`);
    49         testComputed("background-color", `color(${color} 50% -160 160)`, `color(${color} 0.5 0 1)`);
    50         testComputed("background-color", `color(${color} 50% -200 200)`, `color(${color} 0.5 0 1)`);
     46        testComputed("background-color", `color(${color} 20% 0 10/0.5)`, `color(${color} 0.2 0 10 / 0.5)`);
     47        testComputed("background-color", `color(${color} 20% 0 10/50%)`, `color(${color} 0.2 0 10 / 0.5)`);
     48        testComputed("background-color", `color(${color} 400% 0 10/50%)`, `color(${color} 4 0 10 / 0.5)`);
     49        testComputed("background-color", `color(${color} 50% -160 160)`, `color(${color} 0.5 -160 160)`);
     50        testComputed("background-color", `color(${color} 50% -200 200)`, `color(${color} 0.5 -200 200)`);
    5151        testComputed("background-color", `color(${color} 0 0 0 / -10%)`, `color(${color} 0 0 0 / 0)`);
    5252        testComputed("background-color", `color(${color} 0 0 0 / 110%)`, `color(${color} 0 0 0)`);
    5353        testComputed("background-color", `color(${color} 0 0 0 / 300%)`, `color(${color} 0 0 0)`);
    54         testComputed("background-color", `color(${color} 50% -200)`, `color(${color} 0.5 0 0)`);
     54        testComputed("background-color", `color(${color} 50% -200)`, `color(${color} 0.5 -200 0)`);
    5555        testComputed("background-color", `color(${color} 50%)`, `color(${color} 0.5 0 0)`);
    5656        testComputed("background-color", `color(${color})`, `color(${color} 0 0 0)`);
    57         testComputed("background-color", `color(${color} 50% -200 / 0.5)`, `color(${color} 0.5 0 0 / 0.5)`);
     57        testComputed("background-color", `color(${color} 50% -200 / 0.5)`, `color(${color} 0.5 -200 0 / 0.5)`);
    5858        testComputed("background-color", `color(${color} 50% / 0.5)`, `color(${color} 0.5 0 0 / 0.5)`);
    5959        testComputed("background-color", `color(${color} / 0.5)`, `color(${color} 0 0 0 / 0.5)`);
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r287835 r287838  
     12022-01-10  Sam Weinig  <weinig@apple.com>
     2
     3        [CSS Color 4] CSS color() function should not clamp channels to the 0-1 range
     4        https://bugs.webkit.org/show_bug.cgi?id=234697
     5
     6        Reviewed by Darin Adler.
     7
     8        Update tests to include out of gamut examples for RGB types as well as some outside
     9        allowed values for lab/lch/oklab/oklch types (in the latter we clamp as the spec requires.).
     10
     11        * web-platform-tests/css/css-color/color-function-parsing-expected.txt:
     12        * web-platform-tests/css/css-color/color-function-parsing.html:
     13        * web-platform-tests/css/css-color/parsing/color-computed-expected.txt:
     14        * web-platform-tests/css/css-color/parsing/color-computed.html:
     15        * web-platform-tests/css/css-color/parsing/color-mix-computed-expected.txt:
     16        * web-platform-tests/css/css-color/parsing/color-mix-computed.html:
     17        * web-platform-tests/css/css-color/parsing/color-mix-valid-expected.txt:
     18        * web-platform-tests/css/css-color/parsing/color-mix-valid.html:
     19        * web-platform-tests/css/css-color/parsing/color-valid-expected.txt:
     20        * web-platform-tests/css/css-color/parsing/color-valid.html:
     21        * web-platform-tests/css/css-color/parsing/relative-color-computed-expected.txt:
     22        * web-platform-tests/css/css-color/parsing/relative-color-computed.html:
     23        * web-platform-tests/css/css-color/parsing/relative-color-valid-expected.txt:
     24        * web-platform-tests/css/css-color/parsing/relative-color-valid.html:
     25
    1262022-01-10  Antoine Quint  <graouts@webkit.org>
    227
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing-expected.txt

    r277077 r287838  
    1414PASS Display P3 color
    1515PASS Different case for Display P3
    16 PASS sRGB color with negative component should clamp to 0
    17 PASS sRGB color with component > 1 should clamp
    18 PASS Display P3 color with negative component should clamp to 0
    19 PASS Display P3 color with component > 1 should clamp
     16PASS sRGB color with negative component should not clamp to 0
     17PASS sRGB color with component > 1 should not clamp
     18PASS Display P3 color with negative component should not clamp to 0
     19PASS Display P3 color with component > 1 should not clamp
    2020PASS Alpha > 1 should clamp
    2121PASS Negative alpha should clamp
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing.html

    r277077 r287838  
    3232    testColorFunction("Different case for Display P3", "color(dIspLaY-P3 0.6 0.7 0.8)", "color(display-p3 0.6 0.7 0.8)");
    3333
    34     testColorFunction("sRGB color with negative component should clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb 0 0.5 0.75)");
    35     testColorFunction("sRGB color with component > 1 should clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1 0.75)");
    36     testColorFunction("Display P3 color with negative component should clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 0 0.75)");
    37     testColorFunction("Display P3 color with component > 1 should clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 1 1 1)");
     34    testColorFunction("sRGB color with negative component should not clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb -0.25 0.5 0.75)");
     35    testColorFunction("sRGB color with component > 1 should not clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 1.5 0.75)");
     36    testColorFunction("Display P3 color with negative component should not clamp to 0", "color(display-p3 0.5 -199 0.75)", "color(display-p3 0.5 -199 0.75)");
     37    testColorFunction("Display P3 color with component > 1 should not clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 184 1.00001 2347329700000)");
    3838    testColorFunction("Alpha > 1 should clamp", "color(srgb 0.1 0.2 0.3 / 1.9)", "color(srgb 0.1 0.2 0.3)");
    3939    testColorFunction("Negative alpha should clamp", "color(srgb 1 1 1 / -0.2)", "color(srgb 1 1 1 / 0)");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-expected.txt

    r287473 r287838  
    3535PASS Property color value 'color(srgb 50% / 0.5)'
    3636PASS Property color value 'color(srgb / 0.5)'
     37PASS Property color value 'color(srgb 200 200 200)'
     38PASS Property color value 'color(srgb 200 200 200 / 200)'
     39PASS Property color value 'color(srgb -200 -200 -200)'
     40PASS Property color value 'color(srgb -200 -200 -200 / -200)'
     41PASS Property color value 'color(srgb 200% 200% 200%)'
     42PASS Property color value 'color(srgb 200% 200% 200% / 200%)'
     43PASS Property color value 'color(srgb -200% -200% -200% / -200%)'
     44PASS Property color value 'color(srgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
     45PASS Property color value 'color(srgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))'
    3746PASS Property color value 'color(srgb-linear 0% 0% 0%)'
    3847PASS Property color value 'color(srgb-linear 10% 10% 10%)'
     
    5463PASS Property color value 'color(srgb-linear 50% / 0.5)'
    5564PASS Property color value 'color(srgb-linear / 0.5)'
     65PASS Property color value 'color(srgb-linear 200 200 200)'
     66PASS Property color value 'color(srgb-linear 200 200 200 / 200)'
     67PASS Property color value 'color(srgb-linear -200 -200 -200)'
     68PASS Property color value 'color(srgb-linear -200 -200 -200 / -200)'
     69PASS Property color value 'color(srgb-linear 200% 200% 200%)'
     70PASS Property color value 'color(srgb-linear 200% 200% 200% / 200%)'
     71PASS Property color value 'color(srgb-linear -200% -200% -200% / -200%)'
     72PASS Property color value 'color(srgb-linear calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
     73PASS Property color value 'color(srgb-linear calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))'
    5674PASS Property color value 'color(a98-rgb 0% 0% 0%)'
    5775PASS Property color value 'color(a98-rgb 10% 10% 10%)'
     
    7391PASS Property color value 'color(a98-rgb 50% / 0.5)'
    7492PASS Property color value 'color(a98-rgb / 0.5)'
     93PASS Property color value 'color(a98-rgb 200 200 200)'
     94PASS Property color value 'color(a98-rgb 200 200 200 / 200)'
     95PASS Property color value 'color(a98-rgb -200 -200 -200)'
     96PASS Property color value 'color(a98-rgb -200 -200 -200 / -200)'
     97PASS Property color value 'color(a98-rgb 200% 200% 200%)'
     98PASS Property color value 'color(a98-rgb 200% 200% 200% / 200%)'
     99PASS Property color value 'color(a98-rgb -200% -200% -200% / -200%)'
     100PASS Property color value 'color(a98-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
     101PASS Property color value 'color(a98-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))'
    75102PASS Property color value 'color(rec2020 0% 0% 0%)'
    76103PASS Property color value 'color(rec2020 10% 10% 10%)'
     
    92119PASS Property color value 'color(rec2020 50% / 0.5)'
    93120PASS Property color value 'color(rec2020 / 0.5)'
     121PASS Property color value 'color(rec2020 200 200 200)'
     122PASS Property color value 'color(rec2020 200 200 200 / 200)'
     123PASS Property color value 'color(rec2020 -200 -200 -200)'
     124PASS Property color value 'color(rec2020 -200 -200 -200 / -200)'
     125PASS Property color value 'color(rec2020 200% 200% 200%)'
     126PASS Property color value 'color(rec2020 200% 200% 200% / 200%)'
     127PASS Property color value 'color(rec2020 -200% -200% -200% / -200%)'
     128PASS Property color value 'color(rec2020 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
     129PASS Property color value 'color(rec2020 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))'
    94130PASS Property color value 'color(prophoto-rgb 0% 0% 0%)'
    95131PASS Property color value 'color(prophoto-rgb 10% 10% 10%)'
     
    111147PASS Property color value 'color(prophoto-rgb 50% / 0.5)'
    112148PASS Property color value 'color(prophoto-rgb / 0.5)'
     149PASS Property color value 'color(prophoto-rgb 200 200 200)'
     150PASS Property color value 'color(prophoto-rgb 200 200 200 / 200)'
     151PASS Property color value 'color(prophoto-rgb -200 -200 -200)'
     152PASS Property color value 'color(prophoto-rgb -200 -200 -200 / -200)'
     153PASS Property color value 'color(prophoto-rgb 200% 200% 200%)'
     154PASS Property color value 'color(prophoto-rgb 200% 200% 200% / 200%)'
     155PASS Property color value 'color(prophoto-rgb -200% -200% -200% / -200%)'
     156PASS Property color value 'color(prophoto-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
     157PASS Property color value 'color(prophoto-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))'
    113158PASS Property color value 'color(xyz 0 0 0)'
    114159PASS Property color value 'color(xyz 0 0 0 / 1)'
     
    131176PASS Property color value 'color(xyz 1 / 0.5)'
    132177PASS Property color value 'color(xyz / 50%)'
     178PASS Property color value 'color(xyz calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
    133179PASS Property color value 'color(xyz-d50 0 0 0)'
    134180PASS Property color value 'color(xyz-d50 0 0 0 / 1)'
     
    151197PASS Property color value 'color(xyz-d50 1 / 0.5)'
    152198PASS Property color value 'color(xyz-d50 / 50%)'
     199PASS Property color value 'color(xyz-d50 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
    153200PASS Property color value 'color(xyz-d65 0 0 0)'
    154201PASS Property color value 'color(xyz-d65 0 0 0 / 1)'
     
    171218PASS Property color value 'color(xyz-d65 1 / 0.5)'
    172219PASS Property color value 'color(xyz-d65 / 50%)'
     220PASS Property color value 'color(xyz-d65 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))'
    173221PASS Property color value 'lab(0% 0 0)'
    174222PASS Property color value 'lab(0% 0 0 / 1)'
     
    185233PASS Property color value 'lab(50% -20 0)'
    186234PASS Property color value 'lab(50% 0 -20)'
     235PASS Property color value 'lab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))'
     236PASS Property color value 'lab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))'
    187237PASS Property color value 'oklab(0% 0 0)'
    188238PASS Property color value 'oklab(0% 0 0 / 1)'
     
    199249PASS Property color value 'oklab(50% -20 0)'
    200250PASS Property color value 'oklab(50% 0 -20)'
     251PASS Property color value 'oklab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))'
     252PASS Property color value 'oklab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))'
    201253PASS Property color value 'lch(0% 0 0deg)'
    202254PASS Property color value 'lch(0% 0 0deg / 1)'
     
    217269PASS Property color value 'lch(10% 20 20 / 110%)'
    218270PASS Property color value 'lch(10% 20 -700)'
     271PASS Property color value 'lch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))'
     272PASS Property color value 'lch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))'
    219273PASS Property color value 'oklch(0% 0 0deg)'
    220274PASS Property color value 'oklch(0% 0 0deg / 1)'
     
    235289PASS Property color value 'oklch(10% 20 20 / 110%)'
    236290PASS Property color value 'oklch(10% 20 -700)'
     291PASS Property color value 'oklch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))'
     292PASS Property color value 'oklch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))'
    237293
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed.html

    r287473 r287838  
    4545    test_computed_value("color", `color(${colorSpace} 0 0 0 / 1)`, `color(${colorSpace} 0 0 0)`);
    4646    test_computed_value("color", `color(${colorSpace} 0% 0 0 / 0.5)`, `color(${colorSpace} 0 0 0 / 0.5)`);
    47     test_computed_value("color", `color(${colorSpace} 20% 0 10/0.5)`, `color(${colorSpace} 0.2 0 1 / 0.5)`);
    48     test_computed_value("color", `color(${colorSpace} 20% 0 10/50%)`, `color(${colorSpace} 0.2 0 1 / 0.5)`);
    49     test_computed_value("color", `color(${colorSpace} 400% 0 10/50%)`, `color(${colorSpace} 1 0 1 / 0.5)`);
    50     test_computed_value("color", `color(${colorSpace} 50% -160 160)`, `color(${colorSpace} 0.5 0 1)`);
    51     test_computed_value("color", `color(${colorSpace} 50% -200 200)`, `color(${colorSpace} 0.5 0 1)`);
     47    test_computed_value("color", `color(${colorSpace} 20% 0 10/0.5)`, `color(${colorSpace} 0.2 0 10 / 0.5)`);
     48    test_computed_value("color", `color(${colorSpace} 20% 0 10/50%)`, `color(${colorSpace} 0.2 0 10 / 0.5)`);
     49    test_computed_value("color", `color(${colorSpace} 400% 0 10/50%)`, `color(${colorSpace} 4 0 10 / 0.5)`);
     50    test_computed_value("color", `color(${colorSpace} 50% -160 160)`, `color(${colorSpace} 0.5 -160 160)`);
     51    test_computed_value("color", `color(${colorSpace} 50% -200 200)`, `color(${colorSpace} 0.5 -200 200)`);
    5252    test_computed_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${colorSpace} 0 0 0 / 0)`);
    5353    test_computed_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${colorSpace} 0 0 0)`);
    5454    test_computed_value("color", `color(${colorSpace} 0 0 0 / 300%)`, `color(${colorSpace} 0 0 0)`);
    55     test_computed_value("color", `color(${colorSpace} 50% -200)`, `color(${colorSpace} 0.5 0 0)`);
     55    test_computed_value("color", `color(${colorSpace} 50% -200)`, `color(${colorSpace} 0.5 -200 0)`);
    5656    test_computed_value("color", `color(${colorSpace} 50%)`, `color(${colorSpace} 0.5 0 0)`);
    5757    test_computed_value("color", `color(${colorSpace})`, `color(${colorSpace} 0 0 0)`);
    58     test_computed_value("color", `color(${colorSpace} 50% -200 / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`);
     58    test_computed_value("color", `color(${colorSpace} 50% -200 / 0.5)`, `color(${colorSpace} 0.5 -200 0 / 0.5)`);
    5959    test_computed_value("color", `color(${colorSpace} 50% / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`);
    6060    test_computed_value("color", `color(${colorSpace} / 0.5)`, `color(${colorSpace} 0 0 0 / 0.5)`);
     61    test_computed_value("color", `color(${colorSpace} 200 200 200)`, `color(${colorSpace} 200 200 200)`);
     62    test_computed_value("color", `color(${colorSpace} 200 200 200 / 200)`, `color(${colorSpace} 200 200 200)`);
     63    test_computed_value("color", `color(${colorSpace} -200 -200 -200)`, `color(${colorSpace} -200 -200 -200)`);
     64    test_computed_value("color", `color(${colorSpace} -200 -200 -200 / -200)`, `color(${colorSpace} -200 -200 -200 / 0)`);
     65    test_computed_value("color", `color(${colorSpace} 200% 200% 200%)`, `color(${colorSpace} 2 2 2)`);
     66    test_computed_value("color", `color(${colorSpace} 200% 200% 200% / 200%)`, `color(${colorSpace} 2 2 2)`);
     67    test_computed_value("color", `color(${colorSpace} -200% -200% -200% / -200%)`, `color(${colorSpace} -2 -2 -2 / 0)`);
     68    test_computed_value("color", `color(${colorSpace} calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))`, `color(${colorSpace} 1.5 -0.5 0.5 / 0.5)`);
     69    test_computed_value("color", `color(${colorSpace} calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))`, `color(${colorSpace} 1.5 -0.5 0.5 / 0)`);
    6170}
    6271
     
    8493    test_computed_value("color", `color(${colorSpace} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`);
    8594    test_computed_value("color", `color(${colorSpace} / 50%)`, `color(${resultColorSpace} 0 0 0 / 0.5)`);
     95    test_computed_value("color", `color(${colorSpace} calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))`, `color(${resultColorSpace} 1.5 -0.5 0.5 / 0.5)`);
    8696}
    8797
     
    101111    test_computed_value("color", `${colorSpace}(50% -20 0)`, `${colorSpace}(50% -20 0)`);
    102112    test_computed_value("color", `${colorSpace}(50% 0 -20)`, `${colorSpace}(50% 0 -20)`);
     113    test_computed_value("color", `${colorSpace}(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))`, `${colorSpace}(150% -0.5 1.5 / 0.5)`);
     114    test_computed_value("color", `${colorSpace}(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))`, `${colorSpace}(0% 1.5 -1.5 / 0)`);
    103115}
    104116
     
    122134    test_computed_value("color", `${colorSpace}(10% 20 20 / 110%)`, `${colorSpace}(10% 20 20)`);
    123135    test_computed_value("color", `${colorSpace}(10% 20 -700)`, `${colorSpace}(10% 20 20)`);
     136    test_computed_value("color", `${colorSpace}(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))`, `${colorSpace}(150% 0 40 / 0.5)`);
     137    test_computed_value("color", `${colorSpace}(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))`, `${colorSpace}(0% 1.5 320 / 0)`);
    124138}
    125139</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-computed-expected.txt

    r287473 r287838  
    270270PASS Property color value 'color-mix(in srgb, color(srgb .1 .2 .3 / .4) 12.5%, color(srgb .5 .6 .7 / .8) 37.5%)'
    271271PASS Property color value 'color-mix(in srgb, color(srgb .1 .2 .3 / .4) 0%, color(srgb .5 .6 .7 / .8))'
     272PASS Property color value 'color-mix(in srgb, color(srgb 2 3 4 / 5), color(srgb 4 6 8 / 10))'
     273PASS Property color value 'color-mix(in srgb, color(srgb -2 -3 -4), color(srgb -4 -6 -8))'
     274PASS Property color value 'color-mix(in srgb, color(srgb -2 -3 -4 / -5), color(srgb -4 -6 -8 / -10))'
    272275PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3), color(srgb-linear .5 .6 .7))'
    273276PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3) 25%, color(srgb-linear .5 .6 .7))'
     
    288291PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / .4) 12.5%, color(srgb-linear .5 .6 .7 / .8) 37.5%)'
    289292PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / .4) 0%, color(srgb-linear .5 .6 .7 / .8))'
     293PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear 2 3 4 / 5), color(srgb-linear 4 6 8 / 10))'
     294PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear -2 -3 -4), color(srgb-linear -4 -6 -8))'
     295PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear -2 -3 -4 / -5), color(srgb-linear -4 -6 -8 / -10))'
    290296PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3), color(xyz .5 .6 .7))'
    291297PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3) 25%, color(xyz .5 .6 .7))'
     
    306312PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3 / .4) 12.5%, color(xyz .5 .6 .7 / .8) 37.5%)'
    307313PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3 / .4) 0%, color(xyz .5 .6 .7 / .8))'
     314PASS Property color value 'color-mix(in xyz, color(xyz 2 3 4 / 5), color(xyz 4 6 8 / 10))'
     315PASS Property color value 'color-mix(in xyz, color(xyz -2 -3 -4), color(xyz -4 -6 -8))'
     316PASS Property color value 'color-mix(in xyz, color(xyz -2 -3 -4 / -5), color(xyz -4 -6 -8 / -10))'
    308317PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3), color(xyz-d50 .5 .6 .7))'
    309318PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3) 25%, color(xyz-d50 .5 .6 .7))'
     
    324333PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 12.5%, color(xyz-d50 .5 .6 .7 / .8) 37.5%)'
    325334PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 0%, color(xyz-d50 .5 .6 .7 / .8))'
     335PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 2 3 4 / 5), color(xyz-d50 4 6 8 / 10))'
     336PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 -2 -3 -4), color(xyz-d50 -4 -6 -8))'
     337PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 -2 -3 -4 / -5), color(xyz-d50 -4 -6 -8 / -10))'
    326338PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3), color(xyz-d65 .5 .6 .7))'
    327339PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3) 25%, color(xyz-d65 .5 .6 .7))'
     
    342354PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 12.5%, color(xyz-d65 .5 .6 .7 / .8) 37.5%)'
    343355PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 0%, color(xyz-d65 .5 .6 .7 / .8))'
     356PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 2 3 4 / 5), color(xyz-d65 4 6 8 / 10))'
     357PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 -2 -3 -4), color(xyz-d65 -4 -6 -8))'
     358PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 -2 -3 -4 / -5), color(xyz-d65 -4 -6 -8 / -10))'
    344359
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-computed.html

    r287473 r287838  
    257257        test_computed_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 12.5%, color(${colorSpace} .5 .6 .7 / .8) 37.5%)`, `color(${resultColorSpace} 0.44285715 0.54285717 0.64285713 / 0.35)`); // Scale up < 100% sum, causes alpha multiplication.
    258258        test_computed_value(`color`, `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)`);
     259
     260        test_computed_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} 2 3 4 / 5), color(${colorSpace} 4 6 8 / 10))`, `color(${resultColorSpace} 3 4.5 6)`);
     261        test_computed_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4), color(${colorSpace} -4 -6 -8))`, `color(${resultColorSpace} -3 -4.5 -6)`);
     262        test_computed_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4 / -5), color(${colorSpace} -4 -6 -8 / -10))`, `color(${resultColorSpace} 0 0 0 / 0)`);
    259263    }
    260264</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-valid-expected.txt

    r287473 r287838  
    270270PASS e.style['color'] = "color-mix(in srgb, color(srgb .1 .2 .3 / .4) 12.5%, color(srgb .5 .6 .7 / .8) 37.5%)" should set the property value
    271271PASS e.style['color'] = "color-mix(in srgb, color(srgb .1 .2 .3 / .4) 0%, color(srgb .5 .6 .7 / .8))" should set the property value
     272PASS e.style['color'] = "color-mix(in srgb, color(srgb 2 3 4 / 5), color(srgb 4 6 8 / 10))" should set the property value
     273PASS e.style['color'] = "color-mix(in srgb, color(srgb -2 -3 -4), color(srgb -4 -6 -8))" should set the property value
     274PASS e.style['color'] = "color-mix(in srgb, color(srgb -2 -3 -4 / -5), color(srgb -4 -6 -8 / -10))" should set the property value
    272275PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3), color(srgb-linear .5 .6 .7))" should set the property value
    273276PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3) 25%, color(srgb-linear .5 .6 .7))" should set the property value
     
    288291PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / .4) 12.5%, color(srgb-linear .5 .6 .7 / .8) 37.5%)" should set the property value
    289292PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / .4) 0%, color(srgb-linear .5 .6 .7 / .8))" should set the property value
     293PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear 2 3 4 / 5), color(srgb-linear 4 6 8 / 10))" should set the property value
     294PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear -2 -3 -4), color(srgb-linear -4 -6 -8))" should set the property value
     295PASS e.style['color'] = "color-mix(in srgb-linear, color(srgb-linear -2 -3 -4 / -5), color(srgb-linear -4 -6 -8 / -10))" should set the property value
    290296PASS e.style['color'] = "color-mix(in xyz, color(xyz .1 .2 .3), color(xyz .5 .6 .7))" should set the property value
    291297PASS e.style['color'] = "color-mix(in xyz, color(xyz .1 .2 .3) 25%, color(xyz .5 .6 .7))" should set the property value
     
    306312PASS e.style['color'] = "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 12.5%, color(xyz .5 .6 .7 / .8) 37.5%)" should set the property value
    307313PASS e.style['color'] = "color-mix(in xyz, color(xyz .1 .2 .3 / .4) 0%, color(xyz .5 .6 .7 / .8))" should set the property value
     314PASS e.style['color'] = "color-mix(in xyz, color(xyz 2 3 4 / 5), color(xyz 4 6 8 / 10))" should set the property value
     315PASS e.style['color'] = "color-mix(in xyz, color(xyz -2 -3 -4), color(xyz -4 -6 -8))" should set the property value
     316PASS e.style['color'] = "color-mix(in xyz, color(xyz -2 -3 -4 / -5), color(xyz -4 -6 -8 / -10))" should set the property value
    308317PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3), color(xyz-d50 .5 .6 .7))" should set the property value
    309318PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3) 25%, color(xyz-d50 .5 .6 .7))" should set the property value
     
    324333PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 12.5%, color(xyz-d50 .5 .6 .7 / .8) 37.5%)" should set the property value
    325334PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 0%, color(xyz-d50 .5 .6 .7 / .8))" should set the property value
     335PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 2 3 4 / 5), color(xyz-d50 4 6 8 / 10))" should set the property value
     336PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 -2 -3 -4), color(xyz-d50 -4 -6 -8))" should set the property value
     337PASS e.style['color'] = "color-mix(in xyz-d50, color(xyz-d50 -2 -3 -4 / -5), color(xyz-d50 -4 -6 -8 / -10))" should set the property value
    326338PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3), color(xyz-d65 .5 .6 .7))" should set the property value
    327339PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3) 25%, color(xyz-d65 .5 .6 .7))" should set the property value
     
    342354PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 12.5%, color(xyz-d65 .5 .6 .7 / .8) 37.5%)" should set the property value
    343355PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 0%, color(xyz-d65 .5 .6 .7 / .8))" should set the property value
     356PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 2 3 4 / 5), color(xyz-d65 4 6 8 / 10))" should set the property value
     357PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 -2 -3 -4), color(xyz-d65 -4 -6 -8))" should set the property value
     358PASS e.style['color'] = "color-mix(in xyz-d65, color(xyz-d65 -2 -3 -4 / -5), color(xyz-d65 -4 -6 -8 / -10))" should set the property value
    344359
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-valid.html

    r287473 r287838  
    257257        test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} .1 .2 .3 / .4) 12.5%, color(${colorSpace} .5 .6 .7 / .8) 37.5%)`, `color(${resultColorSpace} 0.44285715 0.54285717 0.64285713 / 0.35)`); // Scale up < 100% sum, causes alpha multiplication.
    258258        test_valid_value(`color`, `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)`);
     259
     260        test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} 2 3 4 / 5), color(${colorSpace} 4 6 8 / 10))`, `color(${resultColorSpace} 3 4.5 6)`);
     261        test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4), color(${colorSpace} -4 -6 -8))`, `color(${resultColorSpace} -3 -4.5 -6)`);
     262        test_valid_value(`color`, `color-mix(in ${colorSpace}, color(${colorSpace} -2 -3 -4 / -5), color(${colorSpace} -4 -6 -8 / -10))`, `color(${resultColorSpace} 0 0 0 / 0)`);
    259263    }
    260264</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-expected.txt

    r287473 r287838  
    3535PASS e.style['color'] = "color(srgb 50% / 0.5)" should set the property value
    3636PASS e.style['color'] = "color(srgb / 0.5)" should set the property value
     37PASS e.style['color'] = "color(srgb 200 200 200)" should set the property value
     38PASS e.style['color'] = "color(srgb 200 200 200 / 200)" should set the property value
     39PASS e.style['color'] = "color(srgb -200 -200 -200)" should set the property value
     40PASS e.style['color'] = "color(srgb -200 -200 -200 / -200)" should set the property value
     41PASS e.style['color'] = "color(srgb 200% 200% 200%)" should set the property value
     42PASS e.style['color'] = "color(srgb 200% 200% 200% / 200%)" should set the property value
     43PASS e.style['color'] = "color(srgb -200% -200% -200% / -200%)" should set the property value
     44PASS e.style['color'] = "color(srgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
     45PASS e.style['color'] = "color(srgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
    3746PASS e.style['color'] = "color(srgb-linear 0% 0% 0%)" should set the property value
    3847PASS e.style['color'] = "color(srgb-linear 10% 10% 10%)" should set the property value
     
    5463PASS e.style['color'] = "color(srgb-linear 50% / 0.5)" should set the property value
    5564PASS e.style['color'] = "color(srgb-linear / 0.5)" should set the property value
     65PASS e.style['color'] = "color(srgb-linear 200 200 200)" should set the property value
     66PASS e.style['color'] = "color(srgb-linear 200 200 200 / 200)" should set the property value
     67PASS e.style['color'] = "color(srgb-linear -200 -200 -200)" should set the property value
     68PASS e.style['color'] = "color(srgb-linear -200 -200 -200 / -200)" should set the property value
     69PASS e.style['color'] = "color(srgb-linear 200% 200% 200%)" should set the property value
     70PASS e.style['color'] = "color(srgb-linear 200% 200% 200% / 200%)" should set the property value
     71PASS e.style['color'] = "color(srgb-linear -200% -200% -200% / -200%)" should set the property value
     72PASS e.style['color'] = "color(srgb-linear calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
     73PASS e.style['color'] = "color(srgb-linear calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
    5674PASS e.style['color'] = "color(a98-rgb 0% 0% 0%)" should set the property value
    5775PASS e.style['color'] = "color(a98-rgb 10% 10% 10%)" should set the property value
     
    7391PASS e.style['color'] = "color(a98-rgb 50% / 0.5)" should set the property value
    7492PASS e.style['color'] = "color(a98-rgb / 0.5)" should set the property value
     93PASS e.style['color'] = "color(a98-rgb 200 200 200)" should set the property value
     94PASS e.style['color'] = "color(a98-rgb 200 200 200 / 200)" should set the property value
     95PASS e.style['color'] = "color(a98-rgb -200 -200 -200)" should set the property value
     96PASS e.style['color'] = "color(a98-rgb -200 -200 -200 / -200)" should set the property value
     97PASS e.style['color'] = "color(a98-rgb 200% 200% 200%)" should set the property value
     98PASS e.style['color'] = "color(a98-rgb 200% 200% 200% / 200%)" should set the property value
     99PASS e.style['color'] = "color(a98-rgb -200% -200% -200% / -200%)" should set the property value
     100PASS e.style['color'] = "color(a98-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
     101PASS e.style['color'] = "color(a98-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
    75102PASS e.style['color'] = "color(rec2020 0% 0% 0%)" should set the property value
    76103PASS e.style['color'] = "color(rec2020 10% 10% 10%)" should set the property value
     
    92119PASS e.style['color'] = "color(rec2020 50% / 0.5)" should set the property value
    93120PASS e.style['color'] = "color(rec2020 / 0.5)" should set the property value
     121PASS e.style['color'] = "color(rec2020 200 200 200)" should set the property value
     122PASS e.style['color'] = "color(rec2020 200 200 200 / 200)" should set the property value
     123PASS e.style['color'] = "color(rec2020 -200 -200 -200)" should set the property value
     124PASS e.style['color'] = "color(rec2020 -200 -200 -200 / -200)" should set the property value
     125PASS e.style['color'] = "color(rec2020 200% 200% 200%)" should set the property value
     126PASS e.style['color'] = "color(rec2020 200% 200% 200% / 200%)" should set the property value
     127PASS e.style['color'] = "color(rec2020 -200% -200% -200% / -200%)" should set the property value
     128PASS e.style['color'] = "color(rec2020 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
     129PASS e.style['color'] = "color(rec2020 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
    94130PASS e.style['color'] = "color(prophoto-rgb 0% 0% 0%)" should set the property value
    95131PASS e.style['color'] = "color(prophoto-rgb 10% 10% 10%)" should set the property value
     
    111147PASS e.style['color'] = "color(prophoto-rgb 50% / 0.5)" should set the property value
    112148PASS e.style['color'] = "color(prophoto-rgb / 0.5)" should set the property value
     149PASS e.style['color'] = "color(prophoto-rgb 200 200 200)" should set the property value
     150PASS e.style['color'] = "color(prophoto-rgb 200 200 200 / 200)" should set the property value
     151PASS e.style['color'] = "color(prophoto-rgb -200 -200 -200)" should set the property value
     152PASS e.style['color'] = "color(prophoto-rgb -200 -200 -200 / -200)" should set the property value
     153PASS e.style['color'] = "color(prophoto-rgb 200% 200% 200%)" should set the property value
     154PASS e.style['color'] = "color(prophoto-rgb 200% 200% 200% / 200%)" should set the property value
     155PASS e.style['color'] = "color(prophoto-rgb -200% -200% -200% / -200%)" should set the property value
     156PASS e.style['color'] = "color(prophoto-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
     157PASS e.style['color'] = "color(prophoto-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
    113158PASS e.style['color'] = "color(xyz 0 0 0)" should set the property value
    114159PASS e.style['color'] = "color(xyz 0 0 0 / 1)" should set the property value
     
    131176PASS e.style['color'] = "color(xyz 1 / 0.5)" should set the property value
    132177PASS e.style['color'] = "color(xyz / 50%)" should set the property value
     178PASS e.style['color'] = "color(xyz calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
    133179PASS e.style['color'] = "color(xyz-d50 0 0 0)" should set the property value
    134180PASS e.style['color'] = "color(xyz-d50 0 0 0 / 1)" should set the property value
     
    151197PASS e.style['color'] = "color(xyz-d50 1 / 0.5)" should set the property value
    152198PASS e.style['color'] = "color(xyz-d50 / 50%)" should set the property value
     199PASS e.style['color'] = "color(xyz-d50 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
    153200PASS e.style['color'] = "color(xyz-d65 0 0 0)" should set the property value
    154201PASS e.style['color'] = "color(xyz-d65 0 0 0 / 1)" should set the property value
     
    171218PASS e.style['color'] = "color(xyz-d65 1 / 0.5)" should set the property value
    172219PASS e.style['color'] = "color(xyz-d65 / 50%)" should set the property value
     220PASS e.style['color'] = "color(xyz-d65 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
    173221PASS e.style['color'] = "lab(0% 0 0)" should set the property value
    174222PASS e.style['color'] = "lab(0% 0 0 / 1)" should set the property value
     
    185233PASS e.style['color'] = "lab(50% -20 0)" should set the property value
    186234PASS e.style['color'] = "lab(50% 0 -20)" should set the property value
     235PASS e.style['color'] = "lab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))" should set the property value
     236PASS e.style['color'] = "lab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))" should set the property value
    187237PASS e.style['color'] = "oklab(0% 0 0)" should set the property value
    188238PASS e.style['color'] = "oklab(0% 0 0 / 1)" should set the property value
     
    199249PASS e.style['color'] = "oklab(50% -20 0)" should set the property value
    200250PASS e.style['color'] = "oklab(50% 0 -20)" should set the property value
     251PASS e.style['color'] = "oklab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))" should set the property value
     252PASS e.style['color'] = "oklab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))" should set the property value
    201253PASS e.style['color'] = "lch(0% 0 0deg)" should set the property value
    202254PASS e.style['color'] = "lch(0% 0 0deg / 1)" should set the property value
     
    217269PASS e.style['color'] = "lch(10% 20 20 / 110%)" should set the property value
    218270PASS e.style['color'] = "lch(10% 20 -700)" should set the property value
     271PASS e.style['color'] = "lch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))" should set the property value
     272PASS e.style['color'] = "lch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))" should set the property value
    219273PASS e.style['color'] = "oklch(0% 0 0deg)" should set the property value
    220274PASS e.style['color'] = "oklch(0% 0 0deg / 1)" should set the property value
     
    235289PASS e.style['color'] = "oklch(10% 20 20 / 110%)" should set the property value
    236290PASS e.style['color'] = "oklch(10% 20 -700)" should set the property value
     291PASS e.style['color'] = "oklch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))" should set the property value
     292PASS e.style['color'] = "oklch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))" should set the property value
    237293
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid.html

    r287473 r287838  
    3636    test_valid_value("color", `color(${colorSpace} 0 0 0 / 1)`, `color(${colorSpace} 0 0 0)`);
    3737    test_valid_value("color", `color(${colorSpace} 0% 0 0 / 0.5)`, `color(${colorSpace} 0 0 0 / 0.5)`);
    38     test_valid_value("color", `color(${colorSpace} 20% 0 10/0.5)`, `color(${colorSpace} 0.2 0 1 / 0.5)`);
    39     test_valid_value("color", `color(${colorSpace} 20% 0 10/50%)`, `color(${colorSpace} 0.2 0 1 / 0.5)`);
    40     test_valid_value("color", `color(${colorSpace} 400% 0 10/50%)`, `color(${colorSpace} 1 0 1 / 0.5)`);
    41     test_valid_value("color", `color(${colorSpace} 50% -160 160)`, `color(${colorSpace} 0.5 0 1)`);
    42     test_valid_value("color", `color(${colorSpace} 50% -200 200)`, `color(${colorSpace} 0.5 0 1)`);
     38    test_valid_value("color", `color(${colorSpace} 20% 0 10/0.5)`, `color(${colorSpace} 0.2 0 10 / 0.5)`);
     39    test_valid_value("color", `color(${colorSpace} 20% 0 10/50%)`, `color(${colorSpace} 0.2 0 10 / 0.5)`);
     40    test_valid_value("color", `color(${colorSpace} 400% 0 10/50%)`, `color(${colorSpace} 4 0 10 / 0.5)`);
     41    test_valid_value("color", `color(${colorSpace} 50% -160 160)`, `color(${colorSpace} 0.5 -160 160)`);
     42    test_valid_value("color", `color(${colorSpace} 50% -200 200)`, `color(${colorSpace} 0.5 -200 200)`);
    4343    test_valid_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${colorSpace} 0 0 0 / 0)`);
    4444    test_valid_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${colorSpace} 0 0 0)`);
    4545    test_valid_value("color", `color(${colorSpace} 0 0 0 / 300%)`, `color(${colorSpace} 0 0 0)`);
    46     test_valid_value("color", `color(${colorSpace} 50% -200)`, `color(${colorSpace} 0.5 0 0)`);
     46    test_valid_value("color", `color(${colorSpace} 50% -200)`, `color(${colorSpace} 0.5 -200 0)`);
    4747    test_valid_value("color", `color(${colorSpace} 50%)`, `color(${colorSpace} 0.5 0 0)`);
    4848    test_valid_value("color", `color(${colorSpace})`, `color(${colorSpace} 0 0 0)`);
    49     test_valid_value("color", `color(${colorSpace} 50% -200 / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`);
     49    test_valid_value("color", `color(${colorSpace} 50% -200 / 0.5)`, `color(${colorSpace} 0.5 -200 0 / 0.5)`);
    5050    test_valid_value("color", `color(${colorSpace} 50% / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`);
    5151    test_valid_value("color", `color(${colorSpace} / 0.5)`, `color(${colorSpace} 0 0 0 / 0.5)`);
     52    test_valid_value("color", `color(${colorSpace} 200 200 200)`, `color(${colorSpace} 200 200 200)`);
     53    test_valid_value("color", `color(${colorSpace} 200 200 200 / 200)`, `color(${colorSpace} 200 200 200)`);
     54    test_valid_value("color", `color(${colorSpace} -200 -200 -200)`, `color(${colorSpace} -200 -200 -200)`);
     55    test_valid_value("color", `color(${colorSpace} -200 -200 -200 / -200)`, `color(${colorSpace} -200 -200 -200 / 0)`);
     56    test_valid_value("color", `color(${colorSpace} 200% 200% 200%)`, `color(${colorSpace} 2 2 2)`);
     57    test_valid_value("color", `color(${colorSpace} 200% 200% 200% / 200%)`, `color(${colorSpace} 2 2 2)`);
     58    test_valid_value("color", `color(${colorSpace} -200% -200% -200% / -200%)`, `color(${colorSpace} -2 -2 -2 / 0)`);
     59    test_valid_value("color", `color(${colorSpace} calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))`, `color(${colorSpace} 1.5 -0.5 0.5 / 0.5)`);
     60    test_valid_value("color", `color(${colorSpace} calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))`, `color(${colorSpace} 1.5 -0.5 0.5 / 0)`);
    5261}
    5362
     
    7584    test_valid_value("color", `color(${colorSpace} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`);
    7685    test_valid_value("color", `color(${colorSpace} / 50%)`, `color(${resultColorSpace} 0 0 0 / 0.5)`);
     86    test_valid_value("color", `color(${colorSpace} calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))`, `color(${resultColorSpace} 1.5 -0.5 0.5 / 0.5)`);
    7787}
    7888
     
    92102    test_valid_value("color", `${colorSpace}(50% -20 0)`, `${colorSpace}(50% -20 0)`);
    93103    test_valid_value("color", `${colorSpace}(50% 0 -20)`, `${colorSpace}(50% 0 -20)`);
     104    test_valid_value("color", `${colorSpace}(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))`, `${colorSpace}(150% -0.5 1.5 / 0.5)`);
     105    test_valid_value("color", `${colorSpace}(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))`, `${colorSpace}(0% 1.5 -1.5 / 0)`);
    94106}
    95107
     
    113125    test_valid_value("color", `${colorSpace}(10% 20 20 / 110%)`, `${colorSpace}(10% 20 20)`);
    114126    test_valid_value("color", `${colorSpace}(10% 20 -700)`, `${colorSpace}(10% 20 20)`);
     127    test_valid_value("color", `${colorSpace}(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))`, `${colorSpace}(150% 0 40 / 0.5)`);
     128    test_valid_value("color", `${colorSpace}(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))`, `${colorSpace}(0% 1.5 320 / 0)`);
    115129}
    116130</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-computed-expected.txt

    r287473 r287838  
    141141PASS Property color value 'lab(from lab(25% 20 50) l a b / alpha)'
    142142PASS Property color value 'lab(from lab(25% 20 50 / 40%) l a b / alpha)'
     143PASS Property color value 'lab(from lab(200% 300 400 / 500%) l a b / alpha)'
     144PASS Property color value 'lab(from lab(-200% -300 -400 / -500%) l a b / alpha)'
    143145PASS Property color value 'lab(from lab(from lab(25% 20 50) l a b) l a b)'
    144146PASS Property color value 'lab(from color(display-p3 0 0 0) l a b / alpha)'
     
    161163PASS Property color value 'lab(from lab(25% 20 50 / 40%) l a 35 / alpha)'
    162164PASS Property color value 'lab(from lab(25% 20 50 / 40%) l a b / .35)'
     165PASS Property color value 'lab(from lab(70% 45 30 / 40%) 200% 300 400 / 500)'
     166PASS Property color value 'lab(from lab(70% 45 30 / 40%) -200% -300 -400 / -500)'
    163167PASS Property color value 'lab(from lab(25% 20 50) l b a)'
    164168PASS Property color value 'lab(from lab(25% 20 50) l a a / a)'
     
    170174PASS Property color value 'oklab(from oklab(25% 20 50) l a b / alpha)'
    171175PASS Property color value 'oklab(from oklab(25% 20 50 / 40%) l a b / alpha)'
     176PASS Property color value 'oklab(from oklab(200% 300 400 / 500%) l a b / alpha)'
     177PASS Property color value 'oklab(from oklab(-200% -300 -400 / -500%) l a b / alpha)'
    172178PASS Property color value 'oklab(from oklab(from oklab(25% 20 50) l a b) l a b)'
    173179PASS Property color value 'oklab(from color(display-p3 0 0 0) l a b / alpha)'
     
    190196PASS Property color value 'oklab(from oklab(25% 20 50 / 40%) l a 35 / alpha)'
    191197PASS Property color value 'oklab(from oklab(25% 20 50 / 40%) l a b / .35)'
     198PASS Property color value 'oklab(from oklab(70% 45 30 / 40%) 200% 300 400 / 500)'
     199PASS Property color value 'oklab(from oklab(70% 45 30 / 40%) -200% -300 -400 / -500)'
    192200PASS Property color value 'oklab(from oklab(25% 20 50) l b a)'
    193201PASS Property color value 'oklab(from oklab(25% 20 50) l a a / a)'
     
    198206PASS Property color value 'lch(from lch(70% 45 30) l c h)'
    199207PASS Property color value 'lch(from lch(70% 45 30) l c h / alpha)'
    200 PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c h/ alpha)'
     208PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c h / alpha)'
     209PASS Property color value 'lch(from lch(200% 300 400 / 500%) l c h / alpha)'
     210PASS Property color value 'lch(from lch(-200% -300 -400 / -500%) l c h / alpha)'
    201211PASS Property color value 'lch(from lch(from lch(70% 45 30) l c h) l c h)'
    202212PASS Property color value 'lch(from color(display-p3 0 0 0) l c h / alpha)'
     
    226236PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c 25deg / alpha)'
    227237PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c h / .25)'
     238PASS Property color value 'lch(from lch(70% 45 30 / 40%) 200% 300 400 / 500)'
     239PASS Property color value 'lch(from lch(70% 45 30 / 40%) -200% -300 -400 / -500)'
     240PASS Property color value 'lch(from lch(70% 45 30 / 40%) 50% 120 400deg / 500)'
     241PASS Property color value 'lch(from lch(70% 45 30 / 40%) 50% 120 -400deg / -500)'
    228242PASS Property color value 'lch(from lch(70% 45 30) alpha c h / l)'
    229243PASS Property color value 'lch(from lch(70% 45 30) l c c / alpha)'
     
    238252PASS Property color value 'oklch(from oklch(70% 45 30) l c h)'
    239253PASS Property color value 'oklch(from oklch(70% 45 30) l c h / alpha)'
    240 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c h/ alpha)'
     254PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c h / alpha)'
     255PASS Property color value 'oklch(from oklch(200% 300 400 / 500%) l c h / alpha)'
     256PASS Property color value 'oklch(from oklch(-200% -300 -400 / -500%) l c h / alpha)'
    241257PASS Property color value 'oklch(from oklch(from oklch(70% 45 30) l c h) l c h)'
    242258PASS Property color value 'oklch(from color(display-p3 0 0 0) l c h / alpha)'
     
    266282PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c 25deg / alpha)'
    267283PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c h / .25)'
     284PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) 200% 300 400 / 500)'
     285PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) -200% -300 -400 / -500)'
     286PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) 50% 120 400deg / 500)'
     287PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) 50% 120 -400deg / -500)'
    268288PASS Property color value 'oklch(from oklch(70% 45 30) alpha c h / l)'
    269289PASS Property color value 'oklch(from oklch(70% 45 30) l c c / alpha)'
     
    307327PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 0.2)'
    308328PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 20%)'
     329PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4)'
     330PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4 / 5)'
     331PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4)'
     332PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4 / -5)'
     333PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400%)'
     334PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400% / 500%)'
     335PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400%)'
     336PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400% / -500%)'
    309337PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb g b r)'
    310338PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb b alpha r / g)'
     
    315343PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r r r / r)'
    316344PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb alpha alpha alpha / alpha)'
     345PASS Property color value 'color(from color(srgb 1.7 1.5 1.3) srgb r g b)'
     346PASS Property color value 'color(from color(srgb 1.7 1.5 1.3) srgb r g b / alpha)'
     347PASS Property color value 'color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b)'
     348PASS Property color value 'color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b / alpha)'
     349PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3) srgb r g b)'
     350PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3) srgb r g b / alpha)'
     351PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b)'
     352PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b / alpha)'
    317353PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb calc(r) calc(g) calc(b))'
    318354PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb calc(r) calc(g) calc(b) / calc(alpha))'
     
    348384PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 0.2)'
    349385PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 20%)'
     386PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4)'
     387PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4 / 5)'
     388PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4)'
     389PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4 / -5)'
     390PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400%)'
     391PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400% / 500%)'
     392PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400%)'
     393PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400% / -500%)'
    350394PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear g b r)'
    351395PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear b alpha r / g)'
     
    356400PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r r r / r)'
    357401PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear alpha alpha alpha / alpha)'
     402PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b)'
     403PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b / alpha)'
     404PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3 / 140%) srgb-linear r g b)'
     405PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3 / 140%) srgb-linear r g b / alpha)'
     406PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b)'
     407PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b / alpha)'
     408PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3 / -40%) srgb-linear r g b)'
     409PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3 / -40%) srgb-linear r g b / alpha)'
    358410PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear calc(r) calc(g) calc(b))'
    359411PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear calc(r) calc(g) calc(b) / calc(alpha))'
     
    389441PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b / 0.2)'
    390442PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b / 20%)'
     443PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4)'
     444PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4 / 5)'
     445PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4)'
     446PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4 / -5)'
     447PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400%)'
     448PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400% / 500%)'
     449PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400%)'
     450PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400% / -500%)'
    391451PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb g b r)'
    392452PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb b alpha r / g)'
     
    397457PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r r r / r)'
    398458PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb alpha alpha alpha / alpha)'
     459PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b)'
     460PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b / alpha)'
     461PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3 / 140%) a98-rgb r g b)'
     462PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3 / 140%) a98-rgb r g b / alpha)'
     463PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b)'
     464PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b / alpha)'
     465PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3 / -40%) a98-rgb r g b)'
     466PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3 / -40%) a98-rgb r g b / alpha)'
    399467PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb calc(r) calc(g) calc(b))'
    400468PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb calc(r) calc(g) calc(b) / calc(alpha))'
     
    430498PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 0.2)'
    431499PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 20%)'
     500PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4)'
     501PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4 / 5)'
     502PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4)'
     503PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4 / -5)'
     504PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400%)'
     505PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400% / 500%)'
     506PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400%)'
     507PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400% / -500%)'
    432508PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 g b r)'
    433509PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 b alpha r / g)'
     
    438514PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r r r / r)'
    439515PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 alpha alpha alpha / alpha)'
     516PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b)'
     517PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b / alpha)'
     518PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b)'
     519PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b / alpha)'
     520PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b)'
     521PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b / alpha)'
     522PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b)'
     523PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b / alpha)'
    440524PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 calc(r) calc(g) calc(b))'
    441525PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 calc(r) calc(g) calc(b) / calc(alpha))'
     
    471555PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r g b / 0.2)'
    472556PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r g b / 20%)'
     557PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4)'
     558PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4 / 5)'
     559PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4)'
     560PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4 / -5)'
     561PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400%)'
     562PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400% / 500%)'
     563PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400%)'
     564PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400% / -500%)'
    473565PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb g b r)'
    474566PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb b alpha r / g)'
     
    479571PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r r r / r)'
    480572PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb alpha alpha alpha / alpha)'
     573PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b)'
     574PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b / alpha)'
     575PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3 / 140%) prophoto-rgb r g b)'
     576PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3 / 140%) prophoto-rgb r g b / alpha)'
     577PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b)'
     578PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b / alpha)'
     579PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3 / -40%) prophoto-rgb r g b)'
     580PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3 / -40%) prophoto-rgb r g b / alpha)'
    481581PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb calc(r) calc(g) calc(b))'
    482582PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb calc(r) calc(g) calc(b) / calc(alpha))'
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-computed.html

    r287473 r287838  
    225225        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50) l a b / alpha)`, `${colorSpace}(25% 20 50)`);
    226226        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a b / alpha)`, `${colorSpace}(25% 20 50 / 0.4)`);
     227        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(200% 300 400 / 500%) l a b / alpha)`, `${colorSpace}(200% 300 400)`);
     228        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(-200% -300 -400 / -500%) l a b / alpha)`, `${colorSpace}(0% -300 -400 / 0)`);
    227229
    228230        // Test nesting relative colors.
     
    253255        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a 35 / alpha)`, `${colorSpace}(25% 20 35 / 0.4)`);
    254256        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a b / .35)`, `${colorSpace}(25% 20 50 / 0.35)`);
     257        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 200% 300 400 / 500)`, `${colorSpace}(200% 300 400)`);
     258        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) -200% -300 -400 / -500)`, `${colorSpace}(0% -300 -400 / 0)`);
    255259
    256260        // Testing valid permutation (types match).
     
    271275        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30) l c h)`, `${colorSpace}(70% 45 30)`);
    272276        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30) l c h / alpha)`, `${colorSpace}(70% 45 30)`);
    273         test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c h/ alpha)`, `${colorSpace}(70% 45 30 / 0.4)`);
     277        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c h / alpha)`, `${colorSpace}(70% 45 30 / 0.4)`);
     278        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(200% 300 400 / 500%) l c h / alpha)`, `${colorSpace}(200% 300 40)`);
     279        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(-200% -300 -400 / -500%) l c h / alpha)`, `${colorSpace}(0% 0 320 / 0)`);
    274280
    275281        // Test nesting relative colors.
     
    307313        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c 25deg / alpha)`, `${colorSpace}(70% 45 25 / 0.4)`);
    308314        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c h / .25)`, `${colorSpace}(70% 45 30 / 0.25)`);
     315        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 200% 300 400 / 500)`, `${colorSpace}(200% 300 40)`);
     316        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) -200% -300 -400 / -500)`, `${colorSpace}(0% 0 320 / 0)`);
     317        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 50% 120 400deg / 500)`, `${colorSpace}(50% 120 40)`);
     318        test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 50% 120 -400deg / -500)`, `${colorSpace}(50% 120 320 / 0)`);
    309319
    310320        // Testing valid permutation (types match).
     
    363373        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} r g b / 0.2)`,                  `color(${colorSpace} 0.7 0.5 0.3 / 0.2)`);
    364374        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} r g b / 20%)`,                  `color(${colorSpace} 0.7 0.5 0.3 / 0.2)`);
     375        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 2 3 4)`,                              `color(${colorSpace} 2 3 4)`);
     376        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 2 3 4 / 5)`,                          `color(${colorSpace} 2 3 4)`);
     377        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -2 -3 -4)`,                           `color(${colorSpace} -2 -3 -4)`);
     378        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -2 -3 -4 / -5)`,                      `color(${colorSpace} -2 -3 -4 / 0)`);
     379        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 200% 300% 400%)`,                     `color(${colorSpace} 2 3 4)`);
     380        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 200% 300% 400% / 500%)`,              `color(${colorSpace} 2 3 4)`);
     381        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -200% -300% -400%)`,                  `color(${colorSpace} -2 -3 -4)`);
     382        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -200% -300% -400% / -500%)`,          `color(${colorSpace} -2 -3 -4 / 0)`);
    365383
    366384        // Testing valid permutation (types match).
     
    373391        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} r r r / r)`,                    `color(${colorSpace} 0.7 0.7 0.7 / 0.7)`);
    374392        test_computed_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} alpha alpha alpha / alpha)`,    `color(${colorSpace} 0.4 0.4 0.4 / 0.4)`);
     393
     394        // Testing out of gamut components.
     395        test_computed_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3) ${colorSpace} r g b)`,                              `color(${colorSpace} 1.7 1.5 1.3)`);
     396        test_computed_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3) ${colorSpace} r g b / alpha)`,                      `color(${colorSpace} 1.7 1.5 1.3)`);
     397        test_computed_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3 / 140%) ${colorSpace} r g b)`,                       `color(${colorSpace} 1.7 1.5 1.3)`);
     398        test_computed_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3 / 140%) ${colorSpace} r g b / alpha)`,               `color(${colorSpace} 1.7 1.5 1.3)`);
     399        test_computed_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3) ${colorSpace} r g b)`,                           `color(${colorSpace} -0.7 -0.5 -0.3)`);
     400        test_computed_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3) ${colorSpace} r g b / alpha)`,                   `color(${colorSpace} -0.7 -0.5 -0.3)`);
     401        test_computed_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3 / -40%) ${colorSpace} r g b)`,                    `color(${colorSpace} -0.7 -0.5 -0.3)`);
     402        test_computed_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3 / -40%) ${colorSpace} r g b / alpha)`,            `color(${colorSpace} -0.7 -0.5 -0.3 / 0)`);
    375403
    376404        // Testing with calc().
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-valid-expected.txt

    r287473 r287838  
    141141PASS e.style['color'] = "lab(from lab(25% 20 50) l a b / alpha)" should set the property value
    142142PASS e.style['color'] = "lab(from lab(25% 20 50 / 40%) l a b / alpha)" should set the property value
     143PASS e.style['color'] = "lab(from lab(200% 300 400 / 500%) l a b / alpha)" should set the property value
     144PASS e.style['color'] = "lab(from lab(-200% -300 -400 / -500%) l a b / alpha)" should set the property value
    143145PASS e.style['color'] = "lab(from lab(from lab(25% 20 50) l a b) l a b)" should set the property value
    144146PASS e.style['color'] = "lab(from color(display-p3 0 0 0) l a b / alpha)" should set the property value
     
    161163PASS e.style['color'] = "lab(from lab(25% 20 50 / 40%) l a 35 / alpha)" should set the property value
    162164PASS e.style['color'] = "lab(from lab(25% 20 50 / 40%) l a b / .35)" should set the property value
     165PASS e.style['color'] = "lab(from lab(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value
     166PASS e.style['color'] = "lab(from lab(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value
    163167PASS e.style['color'] = "lab(from lab(25% 20 50) l b a)" should set the property value
    164168PASS e.style['color'] = "lab(from lab(25% 20 50) l a a / a)" should set the property value
     
    170174PASS e.style['color'] = "oklab(from oklab(25% 20 50) l a b / alpha)" should set the property value
    171175PASS e.style['color'] = "oklab(from oklab(25% 20 50 / 40%) l a b / alpha)" should set the property value
     176PASS e.style['color'] = "oklab(from oklab(200% 300 400 / 500%) l a b / alpha)" should set the property value
     177PASS e.style['color'] = "oklab(from oklab(-200% -300 -400 / -500%) l a b / alpha)" should set the property value
    172178PASS e.style['color'] = "oklab(from oklab(from oklab(25% 20 50) l a b) l a b)" should set the property value
    173179PASS e.style['color'] = "oklab(from color(display-p3 0 0 0) l a b / alpha)" should set the property value
     
    190196PASS e.style['color'] = "oklab(from oklab(25% 20 50 / 40%) l a 35 / alpha)" should set the property value
    191197PASS e.style['color'] = "oklab(from oklab(25% 20 50 / 40%) l a b / .35)" should set the property value
     198PASS e.style['color'] = "oklab(from oklab(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value
     199PASS e.style['color'] = "oklab(from oklab(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value
    192200PASS e.style['color'] = "oklab(from oklab(25% 20 50) l b a)" should set the property value
    193201PASS e.style['color'] = "oklab(from oklab(25% 20 50) l a a / a)" should set the property value
     
    198206PASS e.style['color'] = "lch(from lch(70% 45 30) l c h)" should set the property value
    199207PASS e.style['color'] = "lch(from lch(70% 45 30) l c h / alpha)" should set the property value
    200 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c h/ alpha)" should set the property value
     208PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c h / alpha)" should set the property value
     209PASS e.style['color'] = "lch(from lch(200% 300 400 / 500%) l c h / alpha)" should set the property value
     210PASS e.style['color'] = "lch(from lch(-200% -300 -400 / -500%) l c h / alpha)" should set the property value
    201211PASS e.style['color'] = "lch(from lch(from lch(70% 45 30) l c h) l c h)" should set the property value
    202212PASS e.style['color'] = "lch(from color(display-p3 0 0 0) l c h / alpha)" should set the property value
     
    226236PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c 25deg / alpha)" should set the property value
    227237PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c h / .25)" should set the property value
     238PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value
     239PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value
     240PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) 50% 120 400deg / 500)" should set the property value
     241PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) 50% 120 -400deg / -500)" should set the property value
    228242PASS e.style['color'] = "lch(from lch(70% 45 30) alpha c h / l)" should set the property value
    229243PASS e.style['color'] = "lch(from lch(70% 45 30) l c c / alpha)" should set the property value
     
    238252PASS e.style['color'] = "oklch(from oklch(70% 45 30) l c h)" should set the property value
    239253PASS e.style['color'] = "oklch(from oklch(70% 45 30) l c h / alpha)" should set the property value
    240 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c h/ alpha)" should set the property value
     254PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c h / alpha)" should set the property value
     255PASS e.style['color'] = "oklch(from oklch(200% 300 400 / 500%) l c h / alpha)" should set the property value
     256PASS e.style['color'] = "oklch(from oklch(-200% -300 -400 / -500%) l c h / alpha)" should set the property value
    241257PASS e.style['color'] = "oklch(from oklch(from oklch(70% 45 30) l c h) l c h)" should set the property value
    242258PASS e.style['color'] = "oklch(from color(display-p3 0 0 0) l c h / alpha)" should set the property value
     
    266282PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c 25deg / alpha)" should set the property value
    267283PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c h / .25)" should set the property value
     284PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value
     285PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value
     286PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) 50% 120 400deg / 500)" should set the property value
     287PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) 50% 120 -400deg / -500)" should set the property value
    268288PASS e.style['color'] = "oklch(from oklch(70% 45 30) alpha c h / l)" should set the property value
    269289PASS e.style['color'] = "oklch(from oklch(70% 45 30) l c c / alpha)" should set the property value
     
    307327PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 0.2)" should set the property value
    308328PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 20%)" should set the property value
     329PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4)" should set the property value
     330PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4 / 5)" should set the property value
     331PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4)" should set the property value
     332PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4 / -5)" should set the property value
     333PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400%)" should set the property value
     334PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400% / 500%)" should set the property value
     335PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400%)" should set the property value
     336PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400% / -500%)" should set the property value
    309337PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb g b r)" should set the property value
    310338PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb b alpha r / g)" should set the property value
     
    315343PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r r r / r)" should set the property value
    316344PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb alpha alpha alpha / alpha)" should set the property value
     345PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3) srgb r g b)" should set the property value
     346PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3) srgb r g b / alpha)" should set the property value
     347PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b)" should set the property value
     348PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b / alpha)" should set the property value
     349PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3) srgb r g b)" should set the property value
     350PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3) srgb r g b / alpha)" should set the property value
     351PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b)" should set the property value
     352PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b / alpha)" should set the property value
    317353PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb calc(r) calc(g) calc(b))" should set the property value
    318354PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb calc(r) calc(g) calc(b) / calc(alpha))" should set the property value
     
    348384PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 0.2)" should set the property value
    349385PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 20%)" should set the property value
     386PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4)" should set the property value
     387PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4 / 5)" should set the property value
     388PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4)" should set the property value
     389PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4 / -5)" should set the property value
     390PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400%)" should set the property value
     391PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400% / 500%)" should set the property value
     392PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400%)" should set the property value
     393PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400% / -500%)" should set the property value
    350394PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear g b r)" should set the property value
    351395PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear b alpha r / g)" should set the property value
     
    356400PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r r r / r)" should set the property value
    357401PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear alpha alpha alpha / alpha)" should set the property value
     402PASS e.style['color'] = "color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b)" should set the property value
     403PASS e.style['color'] = "color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b / alpha)" should set the property value
     404PASS e.style['color'] = "color(from color(srgb-linear 1.7 1.5 1.3 / 140%) srgb-linear r g b)" should set the property value
     405PASS e.style['color'] = "color(from color(srgb-linear 1.7 1.5 1.3 / 140%) srgb-linear r g b / alpha)" should set the property value
     406PASS e.style['color'] = "color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b)" should set the property value
     407PASS e.style['color'] = "color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b / alpha)" should set the property value
     408PASS e.style['color'] = "color(from color(srgb-linear -0.7 -0.5 -0.3 / -40%) srgb-linear r g b)" should set the property value
     409PASS e.style['color'] = "color(from color(srgb-linear -0.7 -0.5 -0.3 / -40%) srgb-linear r g b / alpha)" should set the property value
    358410PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear calc(r) calc(g) calc(b))" should set the property value
    359411PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear calc(r) calc(g) calc(b) / calc(alpha))" should set the property value
     
    389441PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b / 0.2)" should set the property value
    390442PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b / 20%)" should set the property value
     443PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4)" should set the property value
     444PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4 / 5)" should set the property value
     445PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4)" should set the property value
     446PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4 / -5)" should set the property value
     447PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400%)" should set the property value
     448PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400% / 500%)" should set the property value
     449PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400%)" should set the property value
     450PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400% / -500%)" should set the property value
    391451PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb g b r)" should set the property value
    392452PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb b alpha r / g)" should set the property value
     
    397457PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r r r / r)" should set the property value
    398458PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb alpha alpha alpha / alpha)" should set the property value
     459PASS e.style['color'] = "color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b)" should set the property value
     460PASS e.style['color'] = "color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b / alpha)" should set the property value
     461PASS e.style['color'] = "color(from color(a98-rgb 1.7 1.5 1.3 / 140%) a98-rgb r g b)" should set the property value
     462PASS e.style['color'] = "color(from color(a98-rgb 1.7 1.5 1.3 / 140%) a98-rgb r g b / alpha)" should set the property value
     463PASS e.style['color'] = "color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b)" should set the property value
     464PASS e.style['color'] = "color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b / alpha)" should set the property value
     465PASS e.style['color'] = "color(from color(a98-rgb -0.7 -0.5 -0.3 / -40%) a98-rgb r g b)" should set the property value
     466PASS e.style['color'] = "color(from color(a98-rgb -0.7 -0.5 -0.3 / -40%) a98-rgb r g b / alpha)" should set the property value
    399467PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb calc(r) calc(g) calc(b))" should set the property value
    400468PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb calc(r) calc(g) calc(b) / calc(alpha))" should set the property value
     
    430498PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 0.2)" should set the property value
    431499PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 20%)" should set the property value
     500PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4)" should set the property value
     501PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4 / 5)" should set the property value
     502PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4)" should set the property value
     503PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4 / -5)" should set the property value
     504PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400%)" should set the property value
     505PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400% / 500%)" should set the property value
     506PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400%)" should set the property value
     507PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400% / -500%)" should set the property value
    432508PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 g b r)" should set the property value
    433509PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 b alpha r / g)" should set the property value
     
    438514PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r r r / r)" should set the property value
    439515PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 alpha alpha alpha / alpha)" should set the property value
     516PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b)" should set the property value
     517PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b / alpha)" should set the property value
     518PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b)" should set the property value
     519PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b / alpha)" should set the property value
     520PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b)" should set the property value
     521PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b / alpha)" should set the property value
     522PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b)" should set the property value
     523PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b / alpha)" should set the property value
    440524PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 calc(r) calc(g) calc(b))" should set the property value
    441525PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 calc(r) calc(g) calc(b) / calc(alpha))" should set the property value
     
    471555PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r g b / 0.2)" should set the property value
    472556PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r g b / 20%)" should set the property value
     557PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4)" should set the property value
     558PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4 / 5)" should set the property value
     559PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4)" should set the property value
     560PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4 / -5)" should set the property value
     561PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400%)" should set the property value
     562PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400% / 500%)" should set the property value
     563PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400%)" should set the property value
     564PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400% / -500%)" should set the property value
    473565PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb g b r)" should set the property value
    474566PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb b alpha r / g)" should set the property value
     
    479571PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r r r / r)" should set the property value
    480572PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb alpha alpha alpha / alpha)" should set the property value
     573PASS e.style['color'] = "color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b)" should set the property value
     574PASS e.style['color'] = "color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b / alpha)" should set the property value
     575PASS e.style['color'] = "color(from color(prophoto-rgb 1.7 1.5 1.3 / 140%) prophoto-rgb r g b)" should set the property value
     576PASS e.style['color'] = "color(from color(prophoto-rgb 1.7 1.5 1.3 / 140%) prophoto-rgb r g b / alpha)" should set the property value
     577PASS e.style['color'] = "color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b)" should set the property value
     578PASS e.style['color'] = "color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b / alpha)" should set the property value
     579PASS e.style['color'] = "color(from color(prophoto-rgb -0.7 -0.5 -0.3 / -40%) prophoto-rgb r g b)" should set the property value
     580PASS e.style['color'] = "color(from color(prophoto-rgb -0.7 -0.5 -0.3 / -40%) prophoto-rgb r g b / alpha)" should set the property value
    481581PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb calc(r) calc(g) calc(b))" should set the property value
    482582PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb calc(r) calc(g) calc(b) / calc(alpha))" should set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-valid.html

    r287473 r287838  
    224224        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50) l a b / alpha)`, `${colorSpace}(25% 20 50)`);
    225225        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a b / alpha)`, `${colorSpace}(25% 20 50 / 0.4)`);
     226        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(200% 300 400 / 500%) l a b / alpha)`, `${colorSpace}(200% 300 400)`);
     227        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(-200% -300 -400 / -500%) l a b / alpha)`, `${colorSpace}(0% -300 -400 / 0)`);
    226228
    227229        // Test nesting relative colors.
     
    252254        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a 35 / alpha)`, `${colorSpace}(25% 20 35 / 0.4)`);
    253255        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a b / .35)`, `${colorSpace}(25% 20 50 / 0.35)`);
     256        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 200% 300 400 / 500)`, `${colorSpace}(200% 300 400)`);
     257        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) -200% -300 -400 / -500)`, `${colorSpace}(0% -300 -400 / 0)`);
    254258
    255259        // Testing valid permutation (types match).
     
    270274        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30) l c h)`, `${colorSpace}(70% 45 30)`);
    271275        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30) l c h / alpha)`, `${colorSpace}(70% 45 30)`);
    272         test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c h/ alpha)`, `${colorSpace}(70% 45 30 / 0.4)`);
     276        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c h / alpha)`, `${colorSpace}(70% 45 30 / 0.4)`);
     277        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(200% 300 400 / 500%) l c h / alpha)`, `${colorSpace}(200% 300 40)`);
     278        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(-200% -300 -400 / -500%) l c h / alpha)`, `${colorSpace}(0% 0 320 / 0)`);
    273279
    274280        // Test nesting relative colors.
     
    306312        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c 25deg / alpha)`, `${colorSpace}(70% 45 25 / 0.4)`);
    307313        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c h / .25)`, `${colorSpace}(70% 45 30 / 0.25)`);
     314        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 200% 300 400 / 500)`, `${colorSpace}(200% 300 40)`);
     315        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) -200% -300 -400 / -500)`, `${colorSpace}(0% 0 320 / 0)`);
     316        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 50% 120 400deg / 500)`, `${colorSpace}(50% 120 40)`);
     317        test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) 50% 120 -400deg / -500)`, `${colorSpace}(50% 120 320 / 0)`);
    308318
    309319        // Testing valid permutation (types match).
     
    362372        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} r g b / 0.2)`,                  `color(${colorSpace} 0.7 0.5 0.3 / 0.2)`);
    363373        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} r g b / 20%)`,                  `color(${colorSpace} 0.7 0.5 0.3 / 0.2)`);
     374        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 2 3 4)`,                              `color(${colorSpace} 2 3 4)`);
     375        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 2 3 4 / 5)`,                          `color(${colorSpace} 2 3 4)`);
     376        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -2 -3 -4)`,                           `color(${colorSpace} -2 -3 -4)`);
     377        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -2 -3 -4 / -5)`,                      `color(${colorSpace} -2 -3 -4 / 0)`);
     378        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 200% 300% 400%)`,                     `color(${colorSpace} 2 3 4)`);
     379        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} 200% 300% 400% / 500%)`,              `color(${colorSpace} 2 3 4)`);
     380        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -200% -300% -400%)`,                  `color(${colorSpace} -2 -3 -4)`);
     381        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} -200% -300% -400% / -500%)`,          `color(${colorSpace} -2 -3 -4 / 0)`);
    364382
    365383        // Testing valid permutation (types match).
     
    373391        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3 / 40%) ${colorSpace} alpha alpha alpha / alpha)`,    `color(${colorSpace} 0.4 0.4 0.4 / 0.4)`);
    374392
     393        // Testing out of gamut components.
     394        test_valid_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3) ${colorSpace} r g b)`,                              `color(${colorSpace} 1.7 1.5 1.3)`);
     395        test_valid_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3) ${colorSpace} r g b / alpha)`,                      `color(${colorSpace} 1.7 1.5 1.3)`);
     396        test_valid_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3 / 140%) ${colorSpace} r g b)`,                       `color(${colorSpace} 1.7 1.5 1.3)`);
     397        test_valid_value(`color`, `color(from color(${colorSpace} 1.7 1.5 1.3 / 140%) ${colorSpace} r g b / alpha)`,               `color(${colorSpace} 1.7 1.5 1.3)`);
     398        test_valid_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3) ${colorSpace} r g b)`,                           `color(${colorSpace} -0.7 -0.5 -0.3)`);
     399        test_valid_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3) ${colorSpace} r g b / alpha)`,                   `color(${colorSpace} -0.7 -0.5 -0.3)`);
     400        test_valid_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3 / -40%) ${colorSpace} r g b)`,                    `color(${colorSpace} -0.7 -0.5 -0.3)`);
     401        test_valid_value(`color`, `color(from color(${colorSpace} -0.7 -0.5 -0.3 / -40%) ${colorSpace} r g b / alpha)`,            `color(${colorSpace} -0.7 -0.5 -0.3 / 0)`);
     402
    375403        // Testing with calc().
    376404        test_valid_value(`color`, `color(from color(${colorSpace} 0.7 0.5 0.3) ${colorSpace} calc(r) calc(g) calc(b))`,                        `color(${colorSpace} 0.7 0.5 0.3)`);
     
    392420        // Testing replacement with 0.
    393421        test_valid_value(`color`, `color(from color(${colorSpace} 7 -20.5 100) ${colorSpace} 0 0 0)`,                              `color(${resultColorSpace} 0 0 0)`);
    394     test_valid_value(`color`, `color(from color(${colorSpace} 7 -20.5 100) ${colorSpace} 0 0 0 / 0)`,                          `color(${resultColorSpace} 0 0 0 / 0)`);
     422        test_valid_value(`color`, `color(from color(${colorSpace} 7 -20.5 100) ${colorSpace} 0 0 0 / 0)`,                          `color(${resultColorSpace} 0 0 0 / 0)`);
    395423        test_valid_value(`color`, `color(from color(${colorSpace} 7 -20.5 100) ${colorSpace} 0 y z / alpha)`,                      `color(${resultColorSpace} 0 -20.5 100)`);
    396424        test_valid_value(`color`, `color(from color(${colorSpace} 7 -20.5 100) ${colorSpace} x 0 z / alpha)`,                      `color(${resultColorSpace} 7 0 100)`);
  • trunk/Source/WebCore/ChangeLog

    r287835 r287838  
     12022-01-10  Sam Weinig  <weinig@apple.com>
     2
     3        [CSS Color 4] CSS color() function should not clamp channels to the 0-1 range
     4        https://bugs.webkit.org/show_bug.cgi?id=234697
     5
     6        Reviewed by Darin Adler.
     7
     8        Allow components outside the the 0-1 range for RGB color function types (e.g. color(srgb -2 15 100)).
     9
     10        * css/parser/CSSPropertyParserHelpers.cpp:
     11        (WebCore::CSSPropertyParserHelpers::parseColorFunctionForRGBTypes):
     12        Remove clamping when parsing RGB color function types (we still clamp for legacy rgb()/rgba() as specified).
     13
     14        (WebCore::CSSPropertyParserHelpers::parseRelativeColorFunctionParameters):
     15        (WebCore::CSSPropertyParserHelpers::parseNonRelativeColorFunctionParameters):
     16        Switch mapping of RGB color function types to their extended counterparts which allow the extended range.
     17 
     18        * platform/graphics/ColorInterpolationMethod.h:
     19        Switch the RGB interpolation color types to the extended counterparts as well to allow out of gamut mixing.
     20
    1212022-01-10  Antoine Quint  <graouts@webkit.org>
    222
  • trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

    r287825 r287838  
    21252125        return { };
    21262126
    2127     auto normalizedRed = std::clamp(channels[0], 0.0, 1.0);
    2128     auto normalizedGreen = std::clamp(channels[1], 0.0, 1.0);
    2129     auto normalizedBlue = std::clamp(channels[2], 0.0, 1.0);
    2130 
    2131     return { ColorType { static_cast<float>(normalizedRed), static_cast<float>(normalizedGreen), static_cast<float>(normalizedBlue), static_cast<float>(*alpha) }, Color::Flags::UseColorFunctionSerialization };
     2127    return { ColorType { static_cast<float>(channels[0]), static_cast<float>(channels[1]), static_cast<float>(channels[2]), static_cast<float>(*alpha) }, Color::Flags::UseColorFunctionSerialization };
    21322128}
    21332129
     
    22442240    switch (args.peek().id()) {
    22452241    case CSSValueA98Rgb:
    2246         return parseRelativeColorFunctionForRGBTypes<A98RGB<float>>(args, WTFMove(originColor), context);
     2242        return parseRelativeColorFunctionForRGBTypes<ExtendedA98RGB<float>>(args, WTFMove(originColor), context);
    22472243    case CSSValueDisplayP3:
    2248         return parseRelativeColorFunctionForRGBTypes<DisplayP3<float>>(args, WTFMove(originColor), context);
     2244        return parseRelativeColorFunctionForRGBTypes<ExtendedDisplayP3<float>>(args, WTFMove(originColor), context);
    22492245    case CSSValueProphotoRgb:
    2250         return parseRelativeColorFunctionForRGBTypes<ProPhotoRGB<float>>(args, WTFMove(originColor), context);
     2246        return parseRelativeColorFunctionForRGBTypes<ExtendedProPhotoRGB<float>>(args, WTFMove(originColor), context);
    22512247    case CSSValueRec2020:
    2252         return parseRelativeColorFunctionForRGBTypes<Rec2020<float>>(args, WTFMove(originColor), context);
     2248        return parseRelativeColorFunctionForRGBTypes<ExtendedRec2020<float>>(args, WTFMove(originColor), context);
    22532249    case CSSValueSRGB:
    2254         return parseRelativeColorFunctionForRGBTypes<SRGBA<float>>(args, WTFMove(originColor), context);
     2250        return parseRelativeColorFunctionForRGBTypes<ExtendedSRGBA<float>>(args, WTFMove(originColor), context);
    22552251    case CSSValueSrgbLinear:
    2256         return parseRelativeColorFunctionForRGBTypes<LinearSRGBA<float>>(args, WTFMove(originColor), context);
     2252        return parseRelativeColorFunctionForRGBTypes<ExtendedLinearSRGBA<float>>(args, WTFMove(originColor), context);
    22572253    case CSSValueXyzD50:
    22582254        return parseRelativeColorFunctionForXYZTypes<XYZA<float, WhitePoint::D50>>(args, WTFMove(originColor), context);
     
    22722268    switch (args.peek().id()) {
    22732269    case CSSValueA98Rgb:
    2274         return parseColorFunctionForRGBTypes<A98RGB<float>>(args, context);
     2270        return parseColorFunctionForRGBTypes<ExtendedA98RGB<float>>(args, context);
    22752271    case CSSValueDisplayP3:
    2276         return parseColorFunctionForRGBTypes<DisplayP3<float>>(args, context);
     2272        return parseColorFunctionForRGBTypes<ExtendedDisplayP3<float>>(args, context);
    22772273    case CSSValueProphotoRgb:
    2278         return parseColorFunctionForRGBTypes<ProPhotoRGB<float>>(args, context);
     2274        return parseColorFunctionForRGBTypes<ExtendedProPhotoRGB<float>>(args, context);
    22792275    case CSSValueRec2020:
    2280         return parseColorFunctionForRGBTypes<Rec2020<float>>(args, context);
     2276        return parseColorFunctionForRGBTypes<ExtendedRec2020<float>>(args, context);
    22812277    case CSSValueSRGB:
    2282         return parseColorFunctionForRGBTypes<SRGBA<float>>(args, context);
     2278        return parseColorFunctionForRGBTypes<ExtendedSRGBA<float>>(args, context);
    22832279    case CSSValueSrgbLinear:
    2284         return parseColorFunctionForRGBTypes<LinearSRGBA<float>>(args, context);
     2280        return parseColorFunctionForRGBTypes<ExtendedLinearSRGBA<float>>(args, context);
    22852281    case CSSValueXyzD50:
    22862282        return parseColorFunctionForXYZTypes<XYZA<float, WhitePoint::D50>>(args, context);
  • trunk/Source/WebCore/platform/graphics/ColorInterpolationMethod.h

    r286925 r287838  
    8787    struct SRGB {
    8888        static constexpr auto interpolationColorSpace = ColorInterpolationColorSpace::SRGB;
    89         using ColorType = WebCore::SRGBA<float>;
     89        using ColorType = WebCore::ExtendedSRGBA<float>;
    9090    };
    9191    struct SRGBLinear {
    9292        static constexpr auto interpolationColorSpace = ColorInterpolationColorSpace::SRGBLinear;
    93         using ColorType = WebCore::LinearSRGBA<float>;
     93        using ColorType = WebCore::ExtendedLinearSRGBA<float>;
    9494    };
    9595    struct XYZD50 {
Note: See TracChangeset for help on using the changeset viewer.