Changeset 287838 in webkit
- Timestamp:
- Jan 10, 2022 9:39:32 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 25 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/css3/color/color-function-computed-style-expected.txt (modified) (1 diff)
-
LayoutTests/css3/color/color-function-computed-style.html (modified) (1 diff)
-
LayoutTests/css3/color/color-function-parsing-expected.txt (modified) (1 diff)
-
LayoutTests/css3/color/color-function-parsing.html (modified) (1 diff)
-
LayoutTests/fast/css/parsing-color-function-expected.txt (modified) (5 diffs)
-
LayoutTests/fast/css/parsing-color-function.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing.html (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-expected.txt (modified) (12 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed.html (modified) (4 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-computed-expected.txt (modified) (5 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-computed.html (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-valid-expected.txt (modified) (5 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-valid.html (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-expected.txt (modified) (12 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid.html (modified) (4 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-computed-expected.txt (modified) (18 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-computed.html (modified) (6 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-valid-expected.txt (modified) (18 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-valid.html (modified) (7 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (modified) (3 diffs)
-
Source/WebCore/platform/graphics/ColorInterpolationMethod.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287836 r287838 1 2022-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 1 18 2022-01-10 Arcady Goldmints-Orlov <agoldmints@igalia.com> 2 19 -
trunk/LayoutTests/css3/color/color-function-computed-style-expected.txt
r208116 r287838 58 58 59 59 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 00.5 0.75)'60 TEST: sRGB color with negative component should not clamp to 0 --> color(srgb -0.25 0.5 0.75) 61 PASS declaration.getPropertyValue('color') is 'color(srgb -0.25 0.5 0.75)' 62 62 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)'63 TEST: sRGB color with component > 1 should not clamp --> color(srgb 0.25 1.5 0.75) 64 PASS declaration.getPropertyValue('color') is 'color(srgb 0.25 1.5 0.75)' 65 65 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 00.75)'66 TEST: Display P3 color with negative component should not clamp to 0 --> color(display-p3 0.5 -199 0.75) 67 PASS declaration.getPropertyValue('color') is 'color(display-p3 0.5 -199 0.75)' 68 68 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)'69 TEST: Display P3 color with component > 1 should not clamp --> color(display-p3 184 1.00001 2347329746587) 70 PASS declaration.getPropertyValue('color') is 'color(display-p3 184 1.00001 2347329700000)' 71 71 72 72 TEST: 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 54 54 debug(""); 55 55 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)"); 56 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)"); 57 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)"); 60 58 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 00.75)");62 testColorFunction("Display P3 color with component > 1 should clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 1 1 1)");59 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)"); 60 testColorFunction("Display P3 color with component > 1 should not clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 184 1.00001 2347329700000)"); 63 61 64 62 testColorFunction("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 58 58 59 59 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 00.5 0.75)'60 TEST: sRGB color with negative component should not clamp to 0 --> color(srgb -0.25 0.5 0.75) 61 PASS declaration.getPropertyValue('color') is 'color(srgb -0.25 0.5 0.75)' 62 62 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)'63 TEST: sRGB color with component > 1 should not clamp --> color(srgb 0.25 1.5 0.75) 64 PASS declaration.getPropertyValue('color') is 'color(srgb 0.25 1.5 0.75)' 65 65 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 00.75)'66 TEST: Display P3 color with negative component should not clamp to 0 --> color(display-p3 0.5 -199 0.75) 67 PASS declaration.getPropertyValue('color') is 'color(display-p3 0.5 -199 0.75)' 68 68 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)'69 TEST: Display P3 color with component > 1 should not clamp --> color(display-p3 184 1.00001 2347329746587) 70 PASS declaration.getPropertyValue('color') is 'color(display-p3 184 1.00001 2347329700000)' 71 71 72 72 TEST: Alpha > 1 should clamp --> color(srgb 0.1 0.2 0.3 / 1.9) -
trunk/LayoutTests/css3/color/color-function-parsing.html
r208116 r287838 53 53 debug(""); 54 54 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)"); 55 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)"); 56 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)"); 59 57 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 00.75)");61 testColorFunction("Display P3 color with component > 1 should clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 1 1 1)");58 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)"); 59 testColorFunction("Display P3 color with component > 1 should not clamp", "color(display-p3 184 1.00001 2347329746587)", "color(display-p3 184 1.00001 2347329700000)"); 62 60 63 61 testColorFunction("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 11 11 PASS computedStyle("background-color", "color(srgb 0 0 0 / 1)") is "color(srgb 0 0 0)" 12 12 PASS 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)"13 PASS computedStyle("background-color", "color(srgb 20% 0 10/0.5)") is "color(srgb 0.2 0 10 / 0.5)" 14 PASS computedStyle("background-color", "color(srgb 20% 0 10/50%)") is "color(srgb 0.2 0 10 / 0.5)" 15 PASS computedStyle("background-color", "color(srgb 400% 0 10/50%)") is "color(srgb 4 0 10 / 0.5)" 16 PASS computedStyle("background-color", "color(srgb 50% -160 160)") is "color(srgb 0.5 -160 160)" 17 PASS computedStyle("background-color", "color(srgb 50% -200 200)") is "color(srgb 0.5 -200 200)" 18 18 PASS computedStyle("background-color", "color(srgb 0 0 0 / -10%)") is "color(srgb 0 0 0 / 0)" 19 19 PASS computedStyle("background-color", "color(srgb 0 0 0 / 110%)") is "color(srgb 0 0 0)" 20 20 PASS 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)"21 PASS computedStyle("background-color", "color(srgb 50% -200)") is "color(srgb 0.5 -200 0)" 22 22 PASS computedStyle("background-color", "color(srgb 50%)") is "color(srgb 0.5 0 0)" 23 23 PASS 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)"24 PASS computedStyle("background-color", "color(srgb 50% -200 / 0.5)") is "color(srgb 0.5 -200 0 / 0.5)" 25 25 PASS computedStyle("background-color", "color(srgb 50% / 0.5)") is "color(srgb 0.5 0 0 / 0.5)" 26 26 PASS computedStyle("background-color", "color(srgb / 0.5)") is "color(srgb 0 0 0 / 0.5)" … … 41 41 PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 1)") is "color(srgb-linear 0 0 0)" 42 42 PASS 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)"43 PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/0.5)") is "color(srgb-linear 0.2 0 10 / 0.5)" 44 PASS computedStyle("background-color", "color(srgb-linear 20% 0 10/50%)") is "color(srgb-linear 0.2 0 10 / 0.5)" 45 PASS computedStyle("background-color", "color(srgb-linear 400% 0 10/50%)") is "color(srgb-linear 4 0 10 / 0.5)" 46 PASS computedStyle("background-color", "color(srgb-linear 50% -160 160)") is "color(srgb-linear 0.5 -160 160)" 47 PASS computedStyle("background-color", "color(srgb-linear 50% -200 200)") is "color(srgb-linear 0.5 -200 200)" 48 48 PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / -10%)") is "color(srgb-linear 0 0 0 / 0)" 49 49 PASS computedStyle("background-color", "color(srgb-linear 0 0 0 / 110%)") is "color(srgb-linear 0 0 0)" 50 50 PASS 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)"51 PASS computedStyle("background-color", "color(srgb-linear 50% -200)") is "color(srgb-linear 0.5 -200 0)" 52 52 PASS computedStyle("background-color", "color(srgb-linear 50%)") is "color(srgb-linear 0.5 0 0)" 53 53 PASS 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)"54 PASS computedStyle("background-color", "color(srgb-linear 50% -200 / 0.5)") is "color(srgb-linear 0.5 -200 0 / 0.5)" 55 55 PASS computedStyle("background-color", "color(srgb-linear 50% / 0.5)") is "color(srgb-linear 0.5 0 0 / 0.5)" 56 56 PASS computedStyle("background-color", "color(srgb-linear / 0.5)") is "color(srgb-linear 0 0 0 / 0.5)" … … 71 71 PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / 1)") is "color(a98-rgb 0 0 0)" 72 72 PASS 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)"73 PASS computedStyle("background-color", "color(a98-rgb 20% 0 10/0.5)") is "color(a98-rgb 0.2 0 10 / 0.5)" 74 PASS computedStyle("background-color", "color(a98-rgb 20% 0 10/50%)") is "color(a98-rgb 0.2 0 10 / 0.5)" 75 PASS computedStyle("background-color", "color(a98-rgb 400% 0 10/50%)") is "color(a98-rgb 4 0 10 / 0.5)" 76 PASS computedStyle("background-color", "color(a98-rgb 50% -160 160)") is "color(a98-rgb 0.5 -160 160)" 77 PASS computedStyle("background-color", "color(a98-rgb 50% -200 200)") is "color(a98-rgb 0.5 -200 200)" 78 78 PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / -10%)") is "color(a98-rgb 0 0 0 / 0)" 79 79 PASS computedStyle("background-color", "color(a98-rgb 0 0 0 / 110%)") is "color(a98-rgb 0 0 0)" 80 80 PASS 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)"81 PASS computedStyle("background-color", "color(a98-rgb 50% -200)") is "color(a98-rgb 0.5 -200 0)" 82 82 PASS computedStyle("background-color", "color(a98-rgb 50%)") is "color(a98-rgb 0.5 0 0)" 83 83 PASS 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)"84 PASS computedStyle("background-color", "color(a98-rgb 50% -200 / 0.5)") is "color(a98-rgb 0.5 -200 0 / 0.5)" 85 85 PASS computedStyle("background-color", "color(a98-rgb 50% / 0.5)") is "color(a98-rgb 0.5 0 0 / 0.5)" 86 86 PASS computedStyle("background-color", "color(a98-rgb / 0.5)") is "color(a98-rgb 0 0 0 / 0.5)" … … 101 101 PASS computedStyle("background-color", "color(rec2020 0 0 0 / 1)") is "color(rec2020 0 0 0)" 102 102 PASS 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)"103 PASS computedStyle("background-color", "color(rec2020 20% 0 10/0.5)") is "color(rec2020 0.2 0 10 / 0.5)" 104 PASS computedStyle("background-color", "color(rec2020 20% 0 10/50%)") is "color(rec2020 0.2 0 10 / 0.5)" 105 PASS computedStyle("background-color", "color(rec2020 400% 0 10/50%)") is "color(rec2020 4 0 10 / 0.5)" 106 PASS computedStyle("background-color", "color(rec2020 50% -160 160)") is "color(rec2020 0.5 -160 160)" 107 PASS computedStyle("background-color", "color(rec2020 50% -200 200)") is "color(rec2020 0.5 -200 200)" 108 108 PASS computedStyle("background-color", "color(rec2020 0 0 0 / -10%)") is "color(rec2020 0 0 0 / 0)" 109 109 PASS computedStyle("background-color", "color(rec2020 0 0 0 / 110%)") is "color(rec2020 0 0 0)" 110 110 PASS 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)"111 PASS computedStyle("background-color", "color(rec2020 50% -200)") is "color(rec2020 0.5 -200 0)" 112 112 PASS computedStyle("background-color", "color(rec2020 50%)") is "color(rec2020 0.5 0 0)" 113 113 PASS 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)"114 PASS computedStyle("background-color", "color(rec2020 50% -200 / 0.5)") is "color(rec2020 0.5 -200 0 / 0.5)" 115 115 PASS computedStyle("background-color", "color(rec2020 50% / 0.5)") is "color(rec2020 0.5 0 0 / 0.5)" 116 116 PASS computedStyle("background-color", "color(rec2020 / 0.5)") is "color(rec2020 0 0 0 / 0.5)" … … 131 131 PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / 1)") is "color(prophoto-rgb 0 0 0)" 132 132 PASS 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)"133 PASS computedStyle("background-color", "color(prophoto-rgb 20% 0 10/0.5)") is "color(prophoto-rgb 0.2 0 10 / 0.5)" 134 PASS computedStyle("background-color", "color(prophoto-rgb 20% 0 10/50%)") is "color(prophoto-rgb 0.2 0 10 / 0.5)" 135 PASS computedStyle("background-color", "color(prophoto-rgb 400% 0 10/50%)") is "color(prophoto-rgb 4 0 10 / 0.5)" 136 PASS computedStyle("background-color", "color(prophoto-rgb 50% -160 160)") is "color(prophoto-rgb 0.5 -160 160)" 137 PASS computedStyle("background-color", "color(prophoto-rgb 50% -200 200)") is "color(prophoto-rgb 0.5 -200 200)" 138 138 PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / -10%)") is "color(prophoto-rgb 0 0 0 / 0)" 139 139 PASS computedStyle("background-color", "color(prophoto-rgb 0 0 0 / 110%)") is "color(prophoto-rgb 0 0 0)" 140 140 PASS 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)"141 PASS computedStyle("background-color", "color(prophoto-rgb 50% -200)") is "color(prophoto-rgb 0.5 -200 0)" 142 142 PASS computedStyle("background-color", "color(prophoto-rgb 50%)") is "color(prophoto-rgb 0.5 0 0)" 143 143 PASS 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)"144 PASS computedStyle("background-color", "color(prophoto-rgb 50% -200 / 0.5)") is "color(prophoto-rgb 0.5 -200 0 / 0.5)" 145 145 PASS computedStyle("background-color", "color(prophoto-rgb 50% / 0.5)") is "color(prophoto-rgb 0.5 0 0 / 0.5)" 146 146 PASS 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 44 44 testComputed("background-color", `color(${color} 0 0 0 / 1)`, `color(${color} 0 0 0)`); 45 45 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)`); 51 51 testComputed("background-color", `color(${color} 0 0 0 / -10%)`, `color(${color} 0 0 0 / 0)`); 52 52 testComputed("background-color", `color(${color} 0 0 0 / 110%)`, `color(${color} 0 0 0)`); 53 53 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)`); 55 55 testComputed("background-color", `color(${color} 50%)`, `color(${color} 0.5 0 0)`); 56 56 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)`); 58 58 testComputed("background-color", `color(${color} 50% / 0.5)`, `color(${color} 0.5 0 0 / 0.5)`); 59 59 testComputed("background-color", `color(${color} / 0.5)`, `color(${color} 0 0 0 / 0.5)`); -
trunk/LayoutTests/imported/w3c/ChangeLog
r287835 r287838 1 2022-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 1 26 2022-01-10 Antoine Quint <graouts@webkit.org> 2 27 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing-expected.txt
r277077 r287838 14 14 PASS Display P3 color 15 15 PASS Different case for Display P3 16 PASS sRGB color with negative component should clamp to 017 PASS sRGB color with component > 1 should clamp18 PASS Display P3 color with negative component should clamp to 019 PASS Display P3 color with component > 1 should clamp16 PASS sRGB color with negative component should not clamp to 0 17 PASS sRGB color with component > 1 should not clamp 18 PASS Display P3 color with negative component should not clamp to 0 19 PASS Display P3 color with component > 1 should not clamp 20 20 PASS Alpha > 1 should clamp 21 21 PASS Negative alpha should clamp -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/color-function-parsing.html
r277077 r287838 32 32 testColorFunction("Different case for Display P3", "color(dIspLaY-P3 0.6 0.7 0.8)", "color(display-p3 0.6 0.7 0.8)"); 33 33 34 testColorFunction("sRGB color with negative component should clamp to 0", "color(srgb -0.25 0.5 0.75)", "color(srgb 00.5 0.75)");35 testColorFunction("sRGB color with component > 1 should clamp", "color(srgb 0.25 1.5 0.75)", "color(srgb 0.25 10.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 00.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)"); 38 38 testColorFunction("Alpha > 1 should clamp", "color(srgb 0.1 0.2 0.3 / 1.9)", "color(srgb 0.1 0.2 0.3)"); 39 39 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 35 35 PASS Property color value 'color(srgb 50% / 0.5)' 36 36 PASS Property color value 'color(srgb / 0.5)' 37 PASS Property color value 'color(srgb 200 200 200)' 38 PASS Property color value 'color(srgb 200 200 200 / 200)' 39 PASS Property color value 'color(srgb -200 -200 -200)' 40 PASS Property color value 'color(srgb -200 -200 -200 / -200)' 41 PASS Property color value 'color(srgb 200% 200% 200%)' 42 PASS Property color value 'color(srgb 200% 200% 200% / 200%)' 43 PASS Property color value 'color(srgb -200% -200% -200% / -200%)' 44 PASS Property color value 'color(srgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 45 PASS Property color value 'color(srgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))' 37 46 PASS Property color value 'color(srgb-linear 0% 0% 0%)' 38 47 PASS Property color value 'color(srgb-linear 10% 10% 10%)' … … 54 63 PASS Property color value 'color(srgb-linear 50% / 0.5)' 55 64 PASS Property color value 'color(srgb-linear / 0.5)' 65 PASS Property color value 'color(srgb-linear 200 200 200)' 66 PASS Property color value 'color(srgb-linear 200 200 200 / 200)' 67 PASS Property color value 'color(srgb-linear -200 -200 -200)' 68 PASS Property color value 'color(srgb-linear -200 -200 -200 / -200)' 69 PASS Property color value 'color(srgb-linear 200% 200% 200%)' 70 PASS Property color value 'color(srgb-linear 200% 200% 200% / 200%)' 71 PASS Property color value 'color(srgb-linear -200% -200% -200% / -200%)' 72 PASS Property color value 'color(srgb-linear calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 73 PASS Property color value 'color(srgb-linear calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))' 56 74 PASS Property color value 'color(a98-rgb 0% 0% 0%)' 57 75 PASS Property color value 'color(a98-rgb 10% 10% 10%)' … … 73 91 PASS Property color value 'color(a98-rgb 50% / 0.5)' 74 92 PASS Property color value 'color(a98-rgb / 0.5)' 93 PASS Property color value 'color(a98-rgb 200 200 200)' 94 PASS Property color value 'color(a98-rgb 200 200 200 / 200)' 95 PASS Property color value 'color(a98-rgb -200 -200 -200)' 96 PASS Property color value 'color(a98-rgb -200 -200 -200 / -200)' 97 PASS Property color value 'color(a98-rgb 200% 200% 200%)' 98 PASS Property color value 'color(a98-rgb 200% 200% 200% / 200%)' 99 PASS Property color value 'color(a98-rgb -200% -200% -200% / -200%)' 100 PASS Property color value 'color(a98-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 101 PASS Property color value 'color(a98-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))' 75 102 PASS Property color value 'color(rec2020 0% 0% 0%)' 76 103 PASS Property color value 'color(rec2020 10% 10% 10%)' … … 92 119 PASS Property color value 'color(rec2020 50% / 0.5)' 93 120 PASS Property color value 'color(rec2020 / 0.5)' 121 PASS Property color value 'color(rec2020 200 200 200)' 122 PASS Property color value 'color(rec2020 200 200 200 / 200)' 123 PASS Property color value 'color(rec2020 -200 -200 -200)' 124 PASS Property color value 'color(rec2020 -200 -200 -200 / -200)' 125 PASS Property color value 'color(rec2020 200% 200% 200%)' 126 PASS Property color value 'color(rec2020 200% 200% 200% / 200%)' 127 PASS Property color value 'color(rec2020 -200% -200% -200% / -200%)' 128 PASS Property color value 'color(rec2020 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 129 PASS Property color value 'color(rec2020 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))' 94 130 PASS Property color value 'color(prophoto-rgb 0% 0% 0%)' 95 131 PASS Property color value 'color(prophoto-rgb 10% 10% 10%)' … … 111 147 PASS Property color value 'color(prophoto-rgb 50% / 0.5)' 112 148 PASS Property color value 'color(prophoto-rgb / 0.5)' 149 PASS Property color value 'color(prophoto-rgb 200 200 200)' 150 PASS Property color value 'color(prophoto-rgb 200 200 200 / 200)' 151 PASS Property color value 'color(prophoto-rgb -200 -200 -200)' 152 PASS Property color value 'color(prophoto-rgb -200 -200 -200 / -200)' 153 PASS Property color value 'color(prophoto-rgb 200% 200% 200%)' 154 PASS Property color value 'color(prophoto-rgb 200% 200% 200% / 200%)' 155 PASS Property color value 'color(prophoto-rgb -200% -200% -200% / -200%)' 156 PASS Property color value 'color(prophoto-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 157 PASS Property color value 'color(prophoto-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))' 113 158 PASS Property color value 'color(xyz 0 0 0)' 114 159 PASS Property color value 'color(xyz 0 0 0 / 1)' … … 131 176 PASS Property color value 'color(xyz 1 / 0.5)' 132 177 PASS Property color value 'color(xyz / 50%)' 178 PASS Property color value 'color(xyz calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 133 179 PASS Property color value 'color(xyz-d50 0 0 0)' 134 180 PASS Property color value 'color(xyz-d50 0 0 0 / 1)' … … 151 197 PASS Property color value 'color(xyz-d50 1 / 0.5)' 152 198 PASS Property color value 'color(xyz-d50 / 50%)' 199 PASS Property color value 'color(xyz-d50 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 153 200 PASS Property color value 'color(xyz-d65 0 0 0)' 154 201 PASS Property color value 'color(xyz-d65 0 0 0 / 1)' … … 171 218 PASS Property color value 'color(xyz-d65 1 / 0.5)' 172 219 PASS Property color value 'color(xyz-d65 / 50%)' 220 PASS Property color value 'color(xyz-d65 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))' 173 221 PASS Property color value 'lab(0% 0 0)' 174 222 PASS Property color value 'lab(0% 0 0 / 1)' … … 185 233 PASS Property color value 'lab(50% -20 0)' 186 234 PASS Property color value 'lab(50% 0 -20)' 235 PASS Property color value 'lab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))' 236 PASS Property color value 'lab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))' 187 237 PASS Property color value 'oklab(0% 0 0)' 188 238 PASS Property color value 'oklab(0% 0 0 / 1)' … … 199 249 PASS Property color value 'oklab(50% -20 0)' 200 250 PASS Property color value 'oklab(50% 0 -20)' 251 PASS Property color value 'oklab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))' 252 PASS Property color value 'oklab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))' 201 253 PASS Property color value 'lch(0% 0 0deg)' 202 254 PASS Property color value 'lch(0% 0 0deg / 1)' … … 217 269 PASS Property color value 'lch(10% 20 20 / 110%)' 218 270 PASS Property color value 'lch(10% 20 -700)' 271 PASS Property color value 'lch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))' 272 PASS Property color value 'lch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))' 219 273 PASS Property color value 'oklch(0% 0 0deg)' 220 274 PASS Property color value 'oklch(0% 0 0deg / 1)' … … 235 289 PASS Property color value 'oklch(10% 20 20 / 110%)' 236 290 PASS Property color value 'oklch(10% 20 -700)' 291 PASS Property color value 'oklch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))' 292 PASS Property color value 'oklch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))' 237 293 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed.html
r287473 r287838 45 45 test_computed_value("color", `color(${colorSpace} 0 0 0 / 1)`, `color(${colorSpace} 0 0 0)`); 46 46 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)`); 52 52 test_computed_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${colorSpace} 0 0 0 / 0)`); 53 53 test_computed_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${colorSpace} 0 0 0)`); 54 54 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)`); 56 56 test_computed_value("color", `color(${colorSpace} 50%)`, `color(${colorSpace} 0.5 0 0)`); 57 57 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)`); 59 59 test_computed_value("color", `color(${colorSpace} 50% / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`); 60 60 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)`); 61 70 } 62 71 … … 84 93 test_computed_value("color", `color(${colorSpace} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`); 85 94 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)`); 86 96 } 87 97 … … 101 111 test_computed_value("color", `${colorSpace}(50% -20 0)`, `${colorSpace}(50% -20 0)`); 102 112 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)`); 103 115 } 104 116 … … 122 134 test_computed_value("color", `${colorSpace}(10% 20 20 / 110%)`, `${colorSpace}(10% 20 20)`); 123 135 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)`); 124 138 } 125 139 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-computed-expected.txt
r287473 r287838 270 270 PASS Property color value 'color-mix(in srgb, color(srgb .1 .2 .3 / .4) 12.5%, color(srgb .5 .6 .7 / .8) 37.5%)' 271 271 PASS Property color value 'color-mix(in srgb, color(srgb .1 .2 .3 / .4) 0%, color(srgb .5 .6 .7 / .8))' 272 PASS Property color value 'color-mix(in srgb, color(srgb 2 3 4 / 5), color(srgb 4 6 8 / 10))' 273 PASS Property color value 'color-mix(in srgb, color(srgb -2 -3 -4), color(srgb -4 -6 -8))' 274 PASS Property color value 'color-mix(in srgb, color(srgb -2 -3 -4 / -5), color(srgb -4 -6 -8 / -10))' 272 275 PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3), color(srgb-linear .5 .6 .7))' 273 276 PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3) 25%, color(srgb-linear .5 .6 .7))' … … 288 291 PASS 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%)' 289 292 PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear .1 .2 .3 / .4) 0%, color(srgb-linear .5 .6 .7 / .8))' 293 PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear 2 3 4 / 5), color(srgb-linear 4 6 8 / 10))' 294 PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear -2 -3 -4), color(srgb-linear -4 -6 -8))' 295 PASS Property color value 'color-mix(in srgb-linear, color(srgb-linear -2 -3 -4 / -5), color(srgb-linear -4 -6 -8 / -10))' 290 296 PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3), color(xyz .5 .6 .7))' 291 297 PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3) 25%, color(xyz .5 .6 .7))' … … 306 312 PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3 / .4) 12.5%, color(xyz .5 .6 .7 / .8) 37.5%)' 307 313 PASS Property color value 'color-mix(in xyz, color(xyz .1 .2 .3 / .4) 0%, color(xyz .5 .6 .7 / .8))' 314 PASS Property color value 'color-mix(in xyz, color(xyz 2 3 4 / 5), color(xyz 4 6 8 / 10))' 315 PASS Property color value 'color-mix(in xyz, color(xyz -2 -3 -4), color(xyz -4 -6 -8))' 316 PASS Property color value 'color-mix(in xyz, color(xyz -2 -3 -4 / -5), color(xyz -4 -6 -8 / -10))' 308 317 PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3), color(xyz-d50 .5 .6 .7))' 309 318 PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3) 25%, color(xyz-d50 .5 .6 .7))' … … 324 333 PASS 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%)' 325 334 PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 .1 .2 .3 / .4) 0%, color(xyz-d50 .5 .6 .7 / .8))' 335 PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 2 3 4 / 5), color(xyz-d50 4 6 8 / 10))' 336 PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 -2 -3 -4), color(xyz-d50 -4 -6 -8))' 337 PASS Property color value 'color-mix(in xyz-d50, color(xyz-d50 -2 -3 -4 / -5), color(xyz-d50 -4 -6 -8 / -10))' 326 338 PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3), color(xyz-d65 .5 .6 .7))' 327 339 PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3) 25%, color(xyz-d65 .5 .6 .7))' … … 342 354 PASS 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%)' 343 355 PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / .4) 0%, color(xyz-d65 .5 .6 .7 / .8))' 356 PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 2 3 4 / 5), color(xyz-d65 4 6 8 / 10))' 357 PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 -2 -3 -4), color(xyz-d65 -4 -6 -8))' 358 PASS Property color value 'color-mix(in xyz-d65, color(xyz-d65 -2 -3 -4 / -5), color(xyz-d65 -4 -6 -8 / -10))' 344 359 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-computed.html
r287473 r287838 257 257 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. 258 258 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)`); 259 263 } 260 264 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-valid-expected.txt
r287473 r287838 270 270 PASS 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 271 271 PASS 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 272 PASS e.style['color'] = "color-mix(in srgb, color(srgb 2 3 4 / 5), color(srgb 4 6 8 / 10))" should set the property value 273 PASS e.style['color'] = "color-mix(in srgb, color(srgb -2 -3 -4), color(srgb -4 -6 -8))" should set the property value 274 PASS e.style['color'] = "color-mix(in srgb, color(srgb -2 -3 -4 / -5), color(srgb -4 -6 -8 / -10))" should set the property value 272 275 PASS 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 273 276 PASS 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 … … 288 291 PASS 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 289 292 PASS 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 293 PASS 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 294 PASS 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 295 PASS 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 290 296 PASS e.style['color'] = "color-mix(in xyz, color(xyz .1 .2 .3), color(xyz .5 .6 .7))" should set the property value 291 297 PASS e.style['color'] = "color-mix(in xyz, color(xyz .1 .2 .3) 25%, color(xyz .5 .6 .7))" should set the property value … … 306 312 PASS 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 307 313 PASS 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 314 PASS e.style['color'] = "color-mix(in xyz, color(xyz 2 3 4 / 5), color(xyz 4 6 8 / 10))" should set the property value 315 PASS e.style['color'] = "color-mix(in xyz, color(xyz -2 -3 -4), color(xyz -4 -6 -8))" should set the property value 316 PASS e.style['color'] = "color-mix(in xyz, color(xyz -2 -3 -4 / -5), color(xyz -4 -6 -8 / -10))" should set the property value 308 317 PASS 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 309 318 PASS 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 … … 324 333 PASS 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 325 334 PASS 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 335 PASS 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 336 PASS 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 337 PASS 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 326 338 PASS 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 327 339 PASS 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 … … 342 354 PASS 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 343 355 PASS 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 356 PASS 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 357 PASS 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 358 PASS 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 344 359 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-valid.html
r287473 r287838 257 257 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. 258 258 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)`); 259 263 } 260 264 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-expected.txt
r287473 r287838 35 35 PASS e.style['color'] = "color(srgb 50% / 0.5)" should set the property value 36 36 PASS e.style['color'] = "color(srgb / 0.5)" should set the property value 37 PASS e.style['color'] = "color(srgb 200 200 200)" should set the property value 38 PASS e.style['color'] = "color(srgb 200 200 200 / 200)" should set the property value 39 PASS e.style['color'] = "color(srgb -200 -200 -200)" should set the property value 40 PASS e.style['color'] = "color(srgb -200 -200 -200 / -200)" should set the property value 41 PASS e.style['color'] = "color(srgb 200% 200% 200%)" should set the property value 42 PASS e.style['color'] = "color(srgb 200% 200% 200% / 200%)" should set the property value 43 PASS e.style['color'] = "color(srgb -200% -200% -200% / -200%)" should set the property value 44 PASS 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 45 PASS e.style['color'] = "color(srgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value 37 46 PASS e.style['color'] = "color(srgb-linear 0% 0% 0%)" should set the property value 38 47 PASS e.style['color'] = "color(srgb-linear 10% 10% 10%)" should set the property value … … 54 63 PASS e.style['color'] = "color(srgb-linear 50% / 0.5)" should set the property value 55 64 PASS e.style['color'] = "color(srgb-linear / 0.5)" should set the property value 65 PASS e.style['color'] = "color(srgb-linear 200 200 200)" should set the property value 66 PASS e.style['color'] = "color(srgb-linear 200 200 200 / 200)" should set the property value 67 PASS e.style['color'] = "color(srgb-linear -200 -200 -200)" should set the property value 68 PASS e.style['color'] = "color(srgb-linear -200 -200 -200 / -200)" should set the property value 69 PASS e.style['color'] = "color(srgb-linear 200% 200% 200%)" should set the property value 70 PASS e.style['color'] = "color(srgb-linear 200% 200% 200% / 200%)" should set the property value 71 PASS e.style['color'] = "color(srgb-linear -200% -200% -200% / -200%)" should set the property value 72 PASS 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 73 PASS e.style['color'] = "color(srgb-linear calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value 56 74 PASS e.style['color'] = "color(a98-rgb 0% 0% 0%)" should set the property value 57 75 PASS e.style['color'] = "color(a98-rgb 10% 10% 10%)" should set the property value … … 73 91 PASS e.style['color'] = "color(a98-rgb 50% / 0.5)" should set the property value 74 92 PASS e.style['color'] = "color(a98-rgb / 0.5)" should set the property value 93 PASS e.style['color'] = "color(a98-rgb 200 200 200)" should set the property value 94 PASS e.style['color'] = "color(a98-rgb 200 200 200 / 200)" should set the property value 95 PASS e.style['color'] = "color(a98-rgb -200 -200 -200)" should set the property value 96 PASS e.style['color'] = "color(a98-rgb -200 -200 -200 / -200)" should set the property value 97 PASS e.style['color'] = "color(a98-rgb 200% 200% 200%)" should set the property value 98 PASS e.style['color'] = "color(a98-rgb 200% 200% 200% / 200%)" should set the property value 99 PASS e.style['color'] = "color(a98-rgb -200% -200% -200% / -200%)" should set the property value 100 PASS 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 101 PASS e.style['color'] = "color(a98-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value 75 102 PASS e.style['color'] = "color(rec2020 0% 0% 0%)" should set the property value 76 103 PASS e.style['color'] = "color(rec2020 10% 10% 10%)" should set the property value … … 92 119 PASS e.style['color'] = "color(rec2020 50% / 0.5)" should set the property value 93 120 PASS e.style['color'] = "color(rec2020 / 0.5)" should set the property value 121 PASS e.style['color'] = "color(rec2020 200 200 200)" should set the property value 122 PASS e.style['color'] = "color(rec2020 200 200 200 / 200)" should set the property value 123 PASS e.style['color'] = "color(rec2020 -200 -200 -200)" should set the property value 124 PASS e.style['color'] = "color(rec2020 -200 -200 -200 / -200)" should set the property value 125 PASS e.style['color'] = "color(rec2020 200% 200% 200%)" should set the property value 126 PASS e.style['color'] = "color(rec2020 200% 200% 200% / 200%)" should set the property value 127 PASS e.style['color'] = "color(rec2020 -200% -200% -200% / -200%)" should set the property value 128 PASS 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 129 PASS e.style['color'] = "color(rec2020 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value 94 130 PASS e.style['color'] = "color(prophoto-rgb 0% 0% 0%)" should set the property value 95 131 PASS e.style['color'] = "color(prophoto-rgb 10% 10% 10%)" should set the property value … … 111 147 PASS e.style['color'] = "color(prophoto-rgb 50% / 0.5)" should set the property value 112 148 PASS e.style['color'] = "color(prophoto-rgb / 0.5)" should set the property value 149 PASS e.style['color'] = "color(prophoto-rgb 200 200 200)" should set the property value 150 PASS e.style['color'] = "color(prophoto-rgb 200 200 200 / 200)" should set the property value 151 PASS e.style['color'] = "color(prophoto-rgb -200 -200 -200)" should set the property value 152 PASS e.style['color'] = "color(prophoto-rgb -200 -200 -200 / -200)" should set the property value 153 PASS e.style['color'] = "color(prophoto-rgb 200% 200% 200%)" should set the property value 154 PASS e.style['color'] = "color(prophoto-rgb 200% 200% 200% / 200%)" should set the property value 155 PASS e.style['color'] = "color(prophoto-rgb -200% -200% -200% / -200%)" should set the property value 156 PASS 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 157 PASS e.style['color'] = "color(prophoto-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value 113 158 PASS e.style['color'] = "color(xyz 0 0 0)" should set the property value 114 159 PASS e.style['color'] = "color(xyz 0 0 0 / 1)" should set the property value … … 131 176 PASS e.style['color'] = "color(xyz 1 / 0.5)" should set the property value 132 177 PASS e.style['color'] = "color(xyz / 50%)" should set the property value 178 PASS 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 133 179 PASS e.style['color'] = "color(xyz-d50 0 0 0)" should set the property value 134 180 PASS e.style['color'] = "color(xyz-d50 0 0 0 / 1)" should set the property value … … 151 197 PASS e.style['color'] = "color(xyz-d50 1 / 0.5)" should set the property value 152 198 PASS e.style['color'] = "color(xyz-d50 / 50%)" should set the property value 199 PASS 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 153 200 PASS e.style['color'] = "color(xyz-d65 0 0 0)" should set the property value 154 201 PASS e.style['color'] = "color(xyz-d65 0 0 0 / 1)" should set the property value … … 171 218 PASS e.style['color'] = "color(xyz-d65 1 / 0.5)" should set the property value 172 219 PASS e.style['color'] = "color(xyz-d65 / 50%)" should set the property value 220 PASS 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 173 221 PASS e.style['color'] = "lab(0% 0 0)" should set the property value 174 222 PASS e.style['color'] = "lab(0% 0 0 / 1)" should set the property value … … 185 233 PASS e.style['color'] = "lab(50% -20 0)" should set the property value 186 234 PASS e.style['color'] = "lab(50% 0 -20)" should set the property value 235 PASS e.style['color'] = "lab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))" should set the property value 236 PASS e.style['color'] = "lab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))" should set the property value 187 237 PASS e.style['color'] = "oklab(0% 0 0)" should set the property value 188 238 PASS e.style['color'] = "oklab(0% 0 0 / 1)" should set the property value … … 199 249 PASS e.style['color'] = "oklab(50% -20 0)" should set the property value 200 250 PASS e.style['color'] = "oklab(50% 0 -20)" should set the property value 251 PASS e.style['color'] = "oklab(calc(50% * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))" should set the property value 252 PASS e.style['color'] = "oklab(calc(-50% * 3) calc(0.5 + 1) calc(-1.5) / calc(-0.5 * 2))" should set the property value 201 253 PASS e.style['color'] = "lch(0% 0 0deg)" should set the property value 202 254 PASS e.style['color'] = "lch(0% 0 0deg / 1)" should set the property value … … 217 269 PASS e.style['color'] = "lch(10% 20 20 / 110%)" should set the property value 218 270 PASS e.style['color'] = "lch(10% 20 -700)" should set the property value 271 PASS e.style['color'] = "lch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))" should set the property value 272 PASS e.style['color'] = "lch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))" should set the property value 219 273 PASS e.style['color'] = "oklch(0% 0 0deg)" should set the property value 220 274 PASS e.style['color'] = "oklch(0% 0 0deg / 1)" should set the property value … … 235 289 PASS e.style['color'] = "oklch(10% 20 20 / 110%)" should set the property value 236 290 PASS e.style['color'] = "oklch(10% 20 -700)" should set the property value 291 PASS e.style['color'] = "oklch(calc(50% * 3) calc(0.5 - 1) calc(20deg * 2) / calc(-0.5 + 1))" should set the property value 292 PASS e.style['color'] = "oklch(calc(-50% * 3) calc(0.5 + 1) calc(-20deg * 2) / calc(-0.5 * 2))" should set the property value 237 293 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid.html
r287473 r287838 36 36 test_valid_value("color", `color(${colorSpace} 0 0 0 / 1)`, `color(${colorSpace} 0 0 0)`); 37 37 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)`); 43 43 test_valid_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${colorSpace} 0 0 0 / 0)`); 44 44 test_valid_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${colorSpace} 0 0 0)`); 45 45 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)`); 47 47 test_valid_value("color", `color(${colorSpace} 50%)`, `color(${colorSpace} 0.5 0 0)`); 48 48 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)`); 50 50 test_valid_value("color", `color(${colorSpace} 50% / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`); 51 51 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)`); 52 61 } 53 62 … … 75 84 test_valid_value("color", `color(${colorSpace} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`); 76 85 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)`); 77 87 } 78 88 … … 92 102 test_valid_value("color", `${colorSpace}(50% -20 0)`, `${colorSpace}(50% -20 0)`); 93 103 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)`); 94 106 } 95 107 … … 113 125 test_valid_value("color", `${colorSpace}(10% 20 20 / 110%)`, `${colorSpace}(10% 20 20)`); 114 126 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)`); 115 129 } 116 130 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-computed-expected.txt
r287473 r287838 141 141 PASS Property color value 'lab(from lab(25% 20 50) l a b / alpha)' 142 142 PASS Property color value 'lab(from lab(25% 20 50 / 40%) l a b / alpha)' 143 PASS Property color value 'lab(from lab(200% 300 400 / 500%) l a b / alpha)' 144 PASS Property color value 'lab(from lab(-200% -300 -400 / -500%) l a b / alpha)' 143 145 PASS Property color value 'lab(from lab(from lab(25% 20 50) l a b) l a b)' 144 146 PASS Property color value 'lab(from color(display-p3 0 0 0) l a b / alpha)' … … 161 163 PASS Property color value 'lab(from lab(25% 20 50 / 40%) l a 35 / alpha)' 162 164 PASS Property color value 'lab(from lab(25% 20 50 / 40%) l a b / .35)' 165 PASS Property color value 'lab(from lab(70% 45 30 / 40%) 200% 300 400 / 500)' 166 PASS Property color value 'lab(from lab(70% 45 30 / 40%) -200% -300 -400 / -500)' 163 167 PASS Property color value 'lab(from lab(25% 20 50) l b a)' 164 168 PASS Property color value 'lab(from lab(25% 20 50) l a a / a)' … … 170 174 PASS Property color value 'oklab(from oklab(25% 20 50) l a b / alpha)' 171 175 PASS Property color value 'oklab(from oklab(25% 20 50 / 40%) l a b / alpha)' 176 PASS Property color value 'oklab(from oklab(200% 300 400 / 500%) l a b / alpha)' 177 PASS Property color value 'oklab(from oklab(-200% -300 -400 / -500%) l a b / alpha)' 172 178 PASS Property color value 'oklab(from oklab(from oklab(25% 20 50) l a b) l a b)' 173 179 PASS Property color value 'oklab(from color(display-p3 0 0 0) l a b / alpha)' … … 190 196 PASS Property color value 'oklab(from oklab(25% 20 50 / 40%) l a 35 / alpha)' 191 197 PASS Property color value 'oklab(from oklab(25% 20 50 / 40%) l a b / .35)' 198 PASS Property color value 'oklab(from oklab(70% 45 30 / 40%) 200% 300 400 / 500)' 199 PASS Property color value 'oklab(from oklab(70% 45 30 / 40%) -200% -300 -400 / -500)' 192 200 PASS Property color value 'oklab(from oklab(25% 20 50) l b a)' 193 201 PASS Property color value 'oklab(from oklab(25% 20 50) l a a / a)' … … 198 206 PASS Property color value 'lch(from lch(70% 45 30) l c h)' 199 207 PASS 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)' 208 PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c h / alpha)' 209 PASS Property color value 'lch(from lch(200% 300 400 / 500%) l c h / alpha)' 210 PASS Property color value 'lch(from lch(-200% -300 -400 / -500%) l c h / alpha)' 201 211 PASS Property color value 'lch(from lch(from lch(70% 45 30) l c h) l c h)' 202 212 PASS Property color value 'lch(from color(display-p3 0 0 0) l c h / alpha)' … … 226 236 PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c 25deg / alpha)' 227 237 PASS Property color value 'lch(from lch(70% 45 30 / 40%) l c h / .25)' 238 PASS Property color value 'lch(from lch(70% 45 30 / 40%) 200% 300 400 / 500)' 239 PASS Property color value 'lch(from lch(70% 45 30 / 40%) -200% -300 -400 / -500)' 240 PASS Property color value 'lch(from lch(70% 45 30 / 40%) 50% 120 400deg / 500)' 241 PASS Property color value 'lch(from lch(70% 45 30 / 40%) 50% 120 -400deg / -500)' 228 242 PASS Property color value 'lch(from lch(70% 45 30) alpha c h / l)' 229 243 PASS Property color value 'lch(from lch(70% 45 30) l c c / alpha)' … … 238 252 PASS Property color value 'oklch(from oklch(70% 45 30) l c h)' 239 253 PASS 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)' 254 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c h / alpha)' 255 PASS Property color value 'oklch(from oklch(200% 300 400 / 500%) l c h / alpha)' 256 PASS Property color value 'oklch(from oklch(-200% -300 -400 / -500%) l c h / alpha)' 241 257 PASS Property color value 'oklch(from oklch(from oklch(70% 45 30) l c h) l c h)' 242 258 PASS Property color value 'oklch(from color(display-p3 0 0 0) l c h / alpha)' … … 266 282 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c 25deg / alpha)' 267 283 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) l c h / .25)' 284 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) 200% 300 400 / 500)' 285 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) -200% -300 -400 / -500)' 286 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) 50% 120 400deg / 500)' 287 PASS Property color value 'oklch(from oklch(70% 45 30 / 40%) 50% 120 -400deg / -500)' 268 288 PASS Property color value 'oklch(from oklch(70% 45 30) alpha c h / l)' 269 289 PASS Property color value 'oklch(from oklch(70% 45 30) l c c / alpha)' … … 307 327 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 0.2)' 308 328 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 20%)' 329 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4)' 330 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4 / 5)' 331 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4)' 332 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4 / -5)' 333 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400%)' 334 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400% / 500%)' 335 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400%)' 336 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400% / -500%)' 309 337 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb g b r)' 310 338 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb b alpha r / g)' … … 315 343 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r r r / r)' 316 344 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb alpha alpha alpha / alpha)' 345 PASS Property color value 'color(from color(srgb 1.7 1.5 1.3) srgb r g b)' 346 PASS Property color value 'color(from color(srgb 1.7 1.5 1.3) srgb r g b / alpha)' 347 PASS Property color value 'color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b)' 348 PASS Property color value 'color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b / alpha)' 349 PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3) srgb r g b)' 350 PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3) srgb r g b / alpha)' 351 PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b)' 352 PASS Property color value 'color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b / alpha)' 317 353 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3) srgb calc(r) calc(g) calc(b))' 318 354 PASS Property color value 'color(from color(srgb 0.7 0.5 0.3 / 40%) srgb calc(r) calc(g) calc(b) / calc(alpha))' … … 348 384 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 0.2)' 349 385 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r g b / 20%)' 386 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4)' 387 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4 / 5)' 388 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4)' 389 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4 / -5)' 390 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400%)' 391 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400% / 500%)' 392 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400%)' 393 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400% / -500%)' 350 394 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear g b r)' 351 395 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear b alpha r / g)' … … 356 400 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear r r r / r)' 357 401 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3 / 40%) srgb-linear alpha alpha alpha / alpha)' 402 PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b)' 403 PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b / alpha)' 404 PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3 / 140%) srgb-linear r g b)' 405 PASS Property color value 'color(from color(srgb-linear 1.7 1.5 1.3 / 140%) srgb-linear r g b / alpha)' 406 PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b)' 407 PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b / alpha)' 408 PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3 / -40%) srgb-linear r g b)' 409 PASS Property color value 'color(from color(srgb-linear -0.7 -0.5 -0.3 / -40%) srgb-linear r g b / alpha)' 358 410 PASS Property color value 'color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear calc(r) calc(g) calc(b))' 359 411 PASS 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))' … … 389 441 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b / 0.2)' 390 442 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r g b / 20%)' 443 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4)' 444 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4 / 5)' 445 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4)' 446 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4 / -5)' 447 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400%)' 448 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400% / 500%)' 449 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400%)' 450 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400% / -500%)' 391 451 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb g b r)' 392 452 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb b alpha r / g)' … … 397 457 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb r r r / r)' 398 458 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3 / 40%) a98-rgb alpha alpha alpha / alpha)' 459 PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b)' 460 PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b / alpha)' 461 PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3 / 140%) a98-rgb r g b)' 462 PASS Property color value 'color(from color(a98-rgb 1.7 1.5 1.3 / 140%) a98-rgb r g b / alpha)' 463 PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b)' 464 PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b / alpha)' 465 PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3 / -40%) a98-rgb r g b)' 466 PASS Property color value 'color(from color(a98-rgb -0.7 -0.5 -0.3 / -40%) a98-rgb r g b / alpha)' 399 467 PASS Property color value 'color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb calc(r) calc(g) calc(b))' 400 468 PASS 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))' … … 430 498 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 0.2)' 431 499 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 20%)' 500 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4)' 501 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4 / 5)' 502 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4)' 503 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4 / -5)' 504 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400%)' 505 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400% / 500%)' 506 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400%)' 507 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400% / -500%)' 432 508 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 g b r)' 433 509 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 b alpha r / g)' … … 438 514 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r r r / r)' 439 515 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 alpha alpha alpha / alpha)' 516 PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b)' 517 PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b / alpha)' 518 PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b)' 519 PASS Property color value 'color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b / alpha)' 520 PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b)' 521 PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b / alpha)' 522 PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b)' 523 PASS Property color value 'color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b / alpha)' 440 524 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3) rec2020 calc(r) calc(g) calc(b))' 441 525 PASS Property color value 'color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 calc(r) calc(g) calc(b) / calc(alpha))' … … 471 555 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r g b / 0.2)' 472 556 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r g b / 20%)' 557 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4)' 558 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4 / 5)' 559 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4)' 560 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4 / -5)' 561 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400%)' 562 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400% / 500%)' 563 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400%)' 564 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400% / -500%)' 473 565 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb g b r)' 474 566 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb b alpha r / g)' … … 479 571 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb r r r / r)' 480 572 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3 / 40%) prophoto-rgb alpha alpha alpha / alpha)' 573 PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b)' 574 PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b / alpha)' 575 PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3 / 140%) prophoto-rgb r g b)' 576 PASS Property color value 'color(from color(prophoto-rgb 1.7 1.5 1.3 / 140%) prophoto-rgb r g b / alpha)' 577 PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b)' 578 PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b / alpha)' 579 PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3 / -40%) prophoto-rgb r g b)' 580 PASS Property color value 'color(from color(prophoto-rgb -0.7 -0.5 -0.3 / -40%) prophoto-rgb r g b / alpha)' 481 581 PASS Property color value 'color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb calc(r) calc(g) calc(b))' 482 582 PASS 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 225 225 test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50) l a b / alpha)`, `${colorSpace}(25% 20 50)`); 226 226 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)`); 227 229 228 230 // Test nesting relative colors. … … 253 255 test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a 35 / alpha)`, `${colorSpace}(25% 20 35 / 0.4)`); 254 256 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)`); 255 259 256 260 // Testing valid permutation (types match). … … 271 275 test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30) l c h)`, `${colorSpace}(70% 45 30)`); 272 276 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)`); 274 280 275 281 // Test nesting relative colors. … … 307 313 test_computed_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c 25deg / alpha)`, `${colorSpace}(70% 45 25 / 0.4)`); 308 314 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)`); 309 319 310 320 // Testing valid permutation (types match). … … 363 373 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)`); 364 374 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)`); 365 383 366 384 // Testing valid permutation (types match). … … 373 391 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)`); 374 392 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)`); 375 403 376 404 // Testing with calc(). -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-valid-expected.txt
r287473 r287838 141 141 PASS e.style['color'] = "lab(from lab(25% 20 50) l a b / alpha)" should set the property value 142 142 PASS e.style['color'] = "lab(from lab(25% 20 50 / 40%) l a b / alpha)" should set the property value 143 PASS e.style['color'] = "lab(from lab(200% 300 400 / 500%) l a b / alpha)" should set the property value 144 PASS e.style['color'] = "lab(from lab(-200% -300 -400 / -500%) l a b / alpha)" should set the property value 143 145 PASS e.style['color'] = "lab(from lab(from lab(25% 20 50) l a b) l a b)" should set the property value 144 146 PASS e.style['color'] = "lab(from color(display-p3 0 0 0) l a b / alpha)" should set the property value … … 161 163 PASS e.style['color'] = "lab(from lab(25% 20 50 / 40%) l a 35 / alpha)" should set the property value 162 164 PASS e.style['color'] = "lab(from lab(25% 20 50 / 40%) l a b / .35)" should set the property value 165 PASS e.style['color'] = "lab(from lab(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value 166 PASS e.style['color'] = "lab(from lab(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value 163 167 PASS e.style['color'] = "lab(from lab(25% 20 50) l b a)" should set the property value 164 168 PASS e.style['color'] = "lab(from lab(25% 20 50) l a a / a)" should set the property value … … 170 174 PASS e.style['color'] = "oklab(from oklab(25% 20 50) l a b / alpha)" should set the property value 171 175 PASS e.style['color'] = "oklab(from oklab(25% 20 50 / 40%) l a b / alpha)" should set the property value 176 PASS e.style['color'] = "oklab(from oklab(200% 300 400 / 500%) l a b / alpha)" should set the property value 177 PASS e.style['color'] = "oklab(from oklab(-200% -300 -400 / -500%) l a b / alpha)" should set the property value 172 178 PASS e.style['color'] = "oklab(from oklab(from oklab(25% 20 50) l a b) l a b)" should set the property value 173 179 PASS e.style['color'] = "oklab(from color(display-p3 0 0 0) l a b / alpha)" should set the property value … … 190 196 PASS e.style['color'] = "oklab(from oklab(25% 20 50 / 40%) l a 35 / alpha)" should set the property value 191 197 PASS e.style['color'] = "oklab(from oklab(25% 20 50 / 40%) l a b / .35)" should set the property value 198 PASS e.style['color'] = "oklab(from oklab(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value 199 PASS e.style['color'] = "oklab(from oklab(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value 192 200 PASS e.style['color'] = "oklab(from oklab(25% 20 50) l b a)" should set the property value 193 201 PASS e.style['color'] = "oklab(from oklab(25% 20 50) l a a / a)" should set the property value … … 198 206 PASS e.style['color'] = "lch(from lch(70% 45 30) l c h)" should set the property value 199 207 PASS 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 208 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c h / alpha)" should set the property value 209 PASS e.style['color'] = "lch(from lch(200% 300 400 / 500%) l c h / alpha)" should set the property value 210 PASS e.style['color'] = "lch(from lch(-200% -300 -400 / -500%) l c h / alpha)" should set the property value 201 211 PASS e.style['color'] = "lch(from lch(from lch(70% 45 30) l c h) l c h)" should set the property value 202 212 PASS e.style['color'] = "lch(from color(display-p3 0 0 0) l c h / alpha)" should set the property value … … 226 236 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c 25deg / alpha)" should set the property value 227 237 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) l c h / .25)" should set the property value 238 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value 239 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value 240 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) 50% 120 400deg / 500)" should set the property value 241 PASS e.style['color'] = "lch(from lch(70% 45 30 / 40%) 50% 120 -400deg / -500)" should set the property value 228 242 PASS e.style['color'] = "lch(from lch(70% 45 30) alpha c h / l)" should set the property value 229 243 PASS e.style['color'] = "lch(from lch(70% 45 30) l c c / alpha)" should set the property value … … 238 252 PASS e.style['color'] = "oklch(from oklch(70% 45 30) l c h)" should set the property value 239 253 PASS 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 254 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c h / alpha)" should set the property value 255 PASS e.style['color'] = "oklch(from oklch(200% 300 400 / 500%) l c h / alpha)" should set the property value 256 PASS e.style['color'] = "oklch(from oklch(-200% -300 -400 / -500%) l c h / alpha)" should set the property value 241 257 PASS e.style['color'] = "oklch(from oklch(from oklch(70% 45 30) l c h) l c h)" should set the property value 242 258 PASS e.style['color'] = "oklch(from color(display-p3 0 0 0) l c h / alpha)" should set the property value … … 266 282 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c 25deg / alpha)" should set the property value 267 283 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) l c h / .25)" should set the property value 284 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) 200% 300 400 / 500)" should set the property value 285 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) -200% -300 -400 / -500)" should set the property value 286 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) 50% 120 400deg / 500)" should set the property value 287 PASS e.style['color'] = "oklch(from oklch(70% 45 30 / 40%) 50% 120 -400deg / -500)" should set the property value 268 288 PASS e.style['color'] = "oklch(from oklch(70% 45 30) alpha c h / l)" should set the property value 269 289 PASS e.style['color'] = "oklch(from oklch(70% 45 30) l c c / alpha)" should set the property value … … 307 327 PASS 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 308 328 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r g b / 20%)" should set the property value 329 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4)" should set the property value 330 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 2 3 4 / 5)" should set the property value 331 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4)" should set the property value 332 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -2 -3 -4 / -5)" should set the property value 333 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400%)" should set the property value 334 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb 200% 300% 400% / 500%)" should set the property value 335 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400%)" should set the property value 336 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb -200% -300% -400% / -500%)" should set the property value 309 337 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb g b r)" should set the property value 310 338 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3) srgb b alpha r / g)" should set the property value … … 315 343 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb r r r / r)" should set the property value 316 344 PASS e.style['color'] = "color(from color(srgb 0.7 0.5 0.3 / 40%) srgb alpha alpha alpha / alpha)" should set the property value 345 PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3) srgb r g b)" should set the property value 346 PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3) srgb r g b / alpha)" should set the property value 347 PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b)" should set the property value 348 PASS e.style['color'] = "color(from color(srgb 1.7 1.5 1.3 / 140%) srgb r g b / alpha)" should set the property value 349 PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3) srgb r g b)" should set the property value 350 PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3) srgb r g b / alpha)" should set the property value 351 PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b)" should set the property value 352 PASS e.style['color'] = "color(from color(srgb -0.7 -0.5 -0.3 / -40%) srgb r g b / alpha)" should set the property value 317 353 PASS 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 318 354 PASS 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 … … 348 384 PASS 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 349 385 PASS 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 386 PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 2 3 4)" should set the property value 387 PASS 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 388 PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -2 -3 -4)" should set the property value 389 PASS 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 390 PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear 200% 300% 400%)" should set the property value 391 PASS 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 392 PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear -200% -300% -400%)" should set the property value 393 PASS 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 350 394 PASS e.style['color'] = "color(from color(srgb-linear 0.7 0.5 0.3) srgb-linear g b r)" should set the property value 351 395 PASS 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 … … 356 400 PASS 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 357 401 PASS 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 402 PASS e.style['color'] = "color(from color(srgb-linear 1.7 1.5 1.3) srgb-linear r g b)" should set the property value 403 PASS 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 404 PASS 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 405 PASS 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 406 PASS e.style['color'] = "color(from color(srgb-linear -0.7 -0.5 -0.3) srgb-linear r g b)" should set the property value 407 PASS 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 408 PASS 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 409 PASS 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 358 410 PASS 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 359 411 PASS 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 … … 389 441 PASS 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 390 442 PASS 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 443 PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 2 3 4)" should set the property value 444 PASS 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 445 PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -2 -3 -4)" should set the property value 446 PASS 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 447 PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb 200% 300% 400%)" should set the property value 448 PASS 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 449 PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb -200% -300% -400%)" should set the property value 450 PASS 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 391 451 PASS e.style['color'] = "color(from color(a98-rgb 0.7 0.5 0.3) a98-rgb g b r)" should set the property value 392 452 PASS 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 … … 397 457 PASS 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 398 458 PASS 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 459 PASS e.style['color'] = "color(from color(a98-rgb 1.7 1.5 1.3) a98-rgb r g b)" should set the property value 460 PASS 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 461 PASS 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 462 PASS 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 463 PASS e.style['color'] = "color(from color(a98-rgb -0.7 -0.5 -0.3) a98-rgb r g b)" should set the property value 464 PASS 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 465 PASS 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 466 PASS 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 399 467 PASS 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 400 468 PASS 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 … … 430 498 PASS 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 431 499 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r g b / 20%)" should set the property value 500 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4)" should set the property value 501 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 2 3 4 / 5)" should set the property value 502 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4)" should set the property value 503 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -2 -3 -4 / -5)" should set the property value 504 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400%)" should set the property value 505 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 200% 300% 400% / 500%)" should set the property value 506 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400%)" should set the property value 507 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 -200% -300% -400% / -500%)" should set the property value 432 508 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 g b r)" should set the property value 433 509 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3) rec2020 b alpha r / g)" should set the property value … … 438 514 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 r r r / r)" should set the property value 439 515 PASS e.style['color'] = "color(from color(rec2020 0.7 0.5 0.3 / 40%) rec2020 alpha alpha alpha / alpha)" should set the property value 516 PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b)" should set the property value 517 PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3) rec2020 r g b / alpha)" should set the property value 518 PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b)" should set the property value 519 PASS e.style['color'] = "color(from color(rec2020 1.7 1.5 1.3 / 140%) rec2020 r g b / alpha)" should set the property value 520 PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b)" should set the property value 521 PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3) rec2020 r g b / alpha)" should set the property value 522 PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b)" should set the property value 523 PASS e.style['color'] = "color(from color(rec2020 -0.7 -0.5 -0.3 / -40%) rec2020 r g b / alpha)" should set the property value 440 524 PASS 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 441 525 PASS 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 … … 471 555 PASS 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 472 556 PASS 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 557 PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 2 3 4)" should set the property value 558 PASS 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 559 PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -2 -3 -4)" should set the property value 560 PASS 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 561 PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb 200% 300% 400%)" should set the property value 562 PASS 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 563 PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb -200% -300% -400%)" should set the property value 564 PASS 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 473 565 PASS e.style['color'] = "color(from color(prophoto-rgb 0.7 0.5 0.3) prophoto-rgb g b r)" should set the property value 474 566 PASS 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 … … 479 571 PASS 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 480 572 PASS 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 573 PASS e.style['color'] = "color(from color(prophoto-rgb 1.7 1.5 1.3) prophoto-rgb r g b)" should set the property value 574 PASS 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 575 PASS 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 576 PASS 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 577 PASS e.style['color'] = "color(from color(prophoto-rgb -0.7 -0.5 -0.3) prophoto-rgb r g b)" should set the property value 578 PASS 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 579 PASS 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 580 PASS 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 481 581 PASS 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 482 582 PASS 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 224 224 test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50) l a b / alpha)`, `${colorSpace}(25% 20 50)`); 225 225 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)`); 226 228 227 229 // Test nesting relative colors. … … 252 254 test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(25% 20 50 / 40%) l a 35 / alpha)`, `${colorSpace}(25% 20 35 / 0.4)`); 253 255 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)`); 254 258 255 259 // Testing valid permutation (types match). … … 270 274 test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30) l c h)`, `${colorSpace}(70% 45 30)`); 271 275 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)`); 273 279 274 280 // Test nesting relative colors. … … 306 312 test_valid_value(`color`, `${colorSpace}(from ${colorSpace}(70% 45 30 / 40%) l c 25deg / alpha)`, `${colorSpace}(70% 45 25 / 0.4)`); 307 313 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)`); 308 318 309 319 // Testing valid permutation (types match). … … 362 372 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)`); 363 373 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)`); 364 382 365 383 // Testing valid permutation (types match). … … 373 391 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)`); 374 392 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 375 403 // Testing with calc(). 376 404 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)`); … … 392 420 // Testing replacement with 0. 393 421 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)`); 395 423 test_valid_value(`color`, `color(from color(${colorSpace} 7 -20.5 100) ${colorSpace} 0 y z / alpha)`, `color(${resultColorSpace} 0 -20.5 100)`); 396 424 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 1 2022-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 1 21 2022-01-10 Antoine Quint <graouts@webkit.org> 2 22 -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
r287825 r287838 2125 2125 return { }; 2126 2126 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 }; 2132 2128 } 2133 2129 … … 2244 2240 switch (args.peek().id()) { 2245 2241 case CSSValueA98Rgb: 2246 return parseRelativeColorFunctionForRGBTypes< A98RGB<float>>(args, WTFMove(originColor), context);2242 return parseRelativeColorFunctionForRGBTypes<ExtendedA98RGB<float>>(args, WTFMove(originColor), context); 2247 2243 case CSSValueDisplayP3: 2248 return parseRelativeColorFunctionForRGBTypes< DisplayP3<float>>(args, WTFMove(originColor), context);2244 return parseRelativeColorFunctionForRGBTypes<ExtendedDisplayP3<float>>(args, WTFMove(originColor), context); 2249 2245 case CSSValueProphotoRgb: 2250 return parseRelativeColorFunctionForRGBTypes< ProPhotoRGB<float>>(args, WTFMove(originColor), context);2246 return parseRelativeColorFunctionForRGBTypes<ExtendedProPhotoRGB<float>>(args, WTFMove(originColor), context); 2251 2247 case CSSValueRec2020: 2252 return parseRelativeColorFunctionForRGBTypes< Rec2020<float>>(args, WTFMove(originColor), context);2248 return parseRelativeColorFunctionForRGBTypes<ExtendedRec2020<float>>(args, WTFMove(originColor), context); 2253 2249 case CSSValueSRGB: 2254 return parseRelativeColorFunctionForRGBTypes< SRGBA<float>>(args, WTFMove(originColor), context);2250 return parseRelativeColorFunctionForRGBTypes<ExtendedSRGBA<float>>(args, WTFMove(originColor), context); 2255 2251 case CSSValueSrgbLinear: 2256 return parseRelativeColorFunctionForRGBTypes< LinearSRGBA<float>>(args, WTFMove(originColor), context);2252 return parseRelativeColorFunctionForRGBTypes<ExtendedLinearSRGBA<float>>(args, WTFMove(originColor), context); 2257 2253 case CSSValueXyzD50: 2258 2254 return parseRelativeColorFunctionForXYZTypes<XYZA<float, WhitePoint::D50>>(args, WTFMove(originColor), context); … … 2272 2268 switch (args.peek().id()) { 2273 2269 case CSSValueA98Rgb: 2274 return parseColorFunctionForRGBTypes< A98RGB<float>>(args, context);2270 return parseColorFunctionForRGBTypes<ExtendedA98RGB<float>>(args, context); 2275 2271 case CSSValueDisplayP3: 2276 return parseColorFunctionForRGBTypes< DisplayP3<float>>(args, context);2272 return parseColorFunctionForRGBTypes<ExtendedDisplayP3<float>>(args, context); 2277 2273 case CSSValueProphotoRgb: 2278 return parseColorFunctionForRGBTypes< ProPhotoRGB<float>>(args, context);2274 return parseColorFunctionForRGBTypes<ExtendedProPhotoRGB<float>>(args, context); 2279 2275 case CSSValueRec2020: 2280 return parseColorFunctionForRGBTypes< Rec2020<float>>(args, context);2276 return parseColorFunctionForRGBTypes<ExtendedRec2020<float>>(args, context); 2281 2277 case CSSValueSRGB: 2282 return parseColorFunctionForRGBTypes< SRGBA<float>>(args, context);2278 return parseColorFunctionForRGBTypes<ExtendedSRGBA<float>>(args, context); 2283 2279 case CSSValueSrgbLinear: 2284 return parseColorFunctionForRGBTypes< LinearSRGBA<float>>(args, context);2280 return parseColorFunctionForRGBTypes<ExtendedLinearSRGBA<float>>(args, context); 2285 2281 case CSSValueXyzD50: 2286 2282 return parseColorFunctionForXYZTypes<XYZA<float, WhitePoint::D50>>(args, context); -
trunk/Source/WebCore/platform/graphics/ColorInterpolationMethod.h
r286925 r287838 87 87 struct SRGB { 88 88 static constexpr auto interpolationColorSpace = ColorInterpolationColorSpace::SRGB; 89 using ColorType = WebCore:: SRGBA<float>;89 using ColorType = WebCore::ExtendedSRGBA<float>; 90 90 }; 91 91 struct SRGBLinear { 92 92 static constexpr auto interpolationColorSpace = ColorInterpolationColorSpace::SRGBLinear; 93 using ColorType = WebCore:: LinearSRGBA<float>;93 using ColorType = WebCore::ExtendedLinearSRGBA<float>; 94 94 }; 95 95 struct XYZD50 {
Note: See TracChangeset
for help on using the changeset viewer.