blob: b2f89653a40b89e5ff9a06a10768c56013b4a039 [file] [log] [blame]
Test the parsing of lab(...), lch(...), oklab(...) and oklch(...) colors.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
lab(...)
PASS computedStyle("background-color", "lab(0% 0 0)") is "lab(0% 0 0)"
PASS computedStyle("background-color", "lab(0% 0 0 / 1)") is "lab(0% 0 0)"
PASS computedStyle("background-color", "lab(0% 0 0 / 0.5)") is "lab(0% 0 0 / 0.5)"
PASS computedStyle("background-color", "lab(20% 0 10/0.5)") is "lab(20% 0 10 / 0.5)"
PASS computedStyle("background-color", "lab(20% 0 10/50%)") is "lab(20% 0 10 / 0.5)"
PASS computedStyle("background-color", "lab(400% 0 10/50%)") is "lab(400% 0 10 / 0.5)"
PASS computedStyle("background-color", "lab(50% -160 160)") is "lab(50% -160 160)"
PASS computedStyle("background-color", "lab(50% -200 200)") is "lab(50% -200 200)"
PASS computedStyle("background-color", "lab(0% 0 0 / -10%)") is "lab(0% 0 0 / 0)"
PASS computedStyle("background-color", "lab(0% 0 0 / 110%)") is "lab(0% 0 0)"
PASS computedStyle("background-color", "lab(0% 0 0 / 300%)") is "lab(0% 0 0)"
PASS computedStyle("background-color", "lab(-40% 0 0)") is "lab(0% 0 0)"
PASS computedStyle("background-color", "lab(50% -20 0)") is "lab(50% -20 0)"
PASS computedStyle("background-color", "lab(50% 0 -20)") is "lab(50% 0 -20)"
Test invalid values
PASS computedStyle("background-color", "lab(0 0 0)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lab(0% 0% 0)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lab(0% 0 0 1)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lab(0% 0 0 10%)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lab(0% 0 0deg)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lab(0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lab(40% 0 0deg)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "color(lab 20% 0 10 / 50%)") is "rgba(0, 0, 0, 0)"
oklab(...)
PASS computedStyle("background-color", "oklab(0% 0 0)") is "oklab(0% 0 0)"
PASS computedStyle("background-color", "oklab(0% 0 0 / 1)") is "oklab(0% 0 0)"
PASS computedStyle("background-color", "oklab(0% 0 0 / 0.5)") is "oklab(0% 0 0 / 0.5)"
PASS computedStyle("background-color", "oklab(20% 0 10/0.5)") is "oklab(20% 0 10 / 0.5)"
PASS computedStyle("background-color", "oklab(20% 0 10/50%)") is "oklab(20% 0 10 / 0.5)"
PASS computedStyle("background-color", "oklab(400% 0 10/50%)") is "oklab(400% 0 10 / 0.5)"
PASS computedStyle("background-color", "oklab(50% -160 160)") is "oklab(50% -160 160)"
PASS computedStyle("background-color", "oklab(50% -200 200)") is "oklab(50% -200 200)"
PASS computedStyle("background-color", "oklab(0% 0 0 / -10%)") is "oklab(0% 0 0 / 0)"
PASS computedStyle("background-color", "oklab(0% 0 0 / 110%)") is "oklab(0% 0 0)"
PASS computedStyle("background-color", "oklab(0% 0 0 / 300%)") is "oklab(0% 0 0)"
PASS computedStyle("background-color", "oklab(-40% 0 0)") is "oklab(0% 0 0)"
PASS computedStyle("background-color", "oklab(50% -20 0)") is "oklab(50% -20 0)"
PASS computedStyle("background-color", "oklab(50% 0 -20)") is "oklab(50% 0 -20)"
Test invalid values
PASS computedStyle("background-color", "oklab(0 0 0)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklab(0% 0% 0)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklab(0% 0 0 1)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklab(0% 0 0 10%)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklab(0% 0 0deg)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklab(0% 0% 0deg)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklab(40% 0 0deg)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "color(oklab 20% 0 10 / 50%)") is "rgba(0, 0, 0, 0)"
lch(...)
PASS computedStyle("background-color", "lch(0% 0 0deg)") is "lch(0% 0 0)"
PASS computedStyle("background-color", "lch(0% 0 0deg / 1)") is "lch(0% 0 0)"
PASS computedStyle("background-color", "lch(0% 0 0deg / 0.5)") is "lch(0% 0 0 / 0.5)"
PASS computedStyle("background-color", "lch(100% 230 0deg / 0.5)") is "lch(100% 230 0 / 0.5)"
PASS computedStyle("background-color", "lch(20% 50 20deg/0.5)") is "lch(20% 50 20 / 0.5)"
PASS computedStyle("background-color", "lch(20% 50 20deg/50%)") is "lch(20% 50 20 / 0.5)"
PASS computedStyle("background-color", "lch(10% 20 20deg / -10%)") is "lch(10% 20 20 / 0)"
PASS computedStyle("background-color", "lch(10% 20 20deg / 110%)") is "lch(10% 20 20)"
PASS computedStyle("background-color", "lch(10% 20 1.28rad)") is "lch(10% 20 73.3386)"
PASS computedStyle("background-color", "lch(10% 20 380deg)") is "lch(10% 20 20)"
PASS computedStyle("background-color", "lch(10% 20 -340deg)") is "lch(10% 20 20)"
PASS computedStyle("background-color", "lch(10% 20 740deg)") is "lch(10% 20 20)"
PASS computedStyle("background-color", "lch(10% 20 -700deg)") is "lch(10% 20 20)"
PASS computedStyle("background-color", "lch(-40% 0 0)") is "lch(0% 0 0)"
PASS computedStyle("background-color", "lch(20% -20 0)") is "lch(20% 0 0)"
PASS computedStyle("background-color", "lch(0% 0 0 / 0.5)") is "lch(0% 0 0 / 0.5)"
PASS computedStyle("background-color", "lch(10% 20 20 / 110%)") is "lch(10% 20 20)"
PASS computedStyle("background-color", "lch(10% 20 -700)") is "lch(10% 20 20)"
Test invalid values
PASS computedStyle("background-color", "lch(0 0 0 / 0.5)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lch(20% 10 10deg 10)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "lch(20% 10 10deg 10 / 0.5)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "color(lch 20% 0 10 / 50%)") is "rgba(0, 0, 0, 0)"
oklch(...)
PASS computedStyle("background-color", "oklch(0% 0 0deg)") is "oklch(0% 0 0)"
PASS computedStyle("background-color", "oklch(0% 0 0deg / 1)") is "oklch(0% 0 0)"
PASS computedStyle("background-color", "oklch(0% 0 0deg / 0.5)") is "oklch(0% 0 0 / 0.5)"
PASS computedStyle("background-color", "oklch(100% 230 0deg / 0.5)") is "oklch(100% 230 0 / 0.5)"
PASS computedStyle("background-color", "oklch(20% 50 20deg/0.5)") is "oklch(20% 50 20 / 0.5)"
PASS computedStyle("background-color", "oklch(20% 50 20deg/50%)") is "oklch(20% 50 20 / 0.5)"
PASS computedStyle("background-color", "oklch(10% 20 20deg / -10%)") is "oklch(10% 20 20 / 0)"
PASS computedStyle("background-color", "oklch(10% 20 20deg / 110%)") is "oklch(10% 20 20)"
PASS computedStyle("background-color", "oklch(10% 20 1.28rad)") is "oklch(10% 20 73.3386)"
PASS computedStyle("background-color", "oklch(10% 20 380deg)") is "oklch(10% 20 20)"
PASS computedStyle("background-color", "oklch(10% 20 -340deg)") is "oklch(10% 20 20)"
PASS computedStyle("background-color", "oklch(10% 20 740deg)") is "oklch(10% 20 20)"
PASS computedStyle("background-color", "oklch(10% 20 -700deg)") is "oklch(10% 20 20)"
PASS computedStyle("background-color", "oklch(-40% 0 0)") is "oklch(0% 0 0)"
PASS computedStyle("background-color", "oklch(20% -20 0)") is "oklch(20% 0 0)"
PASS computedStyle("background-color", "oklch(0% 0 0 / 0.5)") is "oklch(0% 0 0 / 0.5)"
PASS computedStyle("background-color", "oklch(10% 20 20 / 110%)") is "oklch(10% 20 20)"
PASS computedStyle("background-color", "oklch(10% 20 -700)") is "oklch(10% 20 20)"
Test invalid values
PASS computedStyle("background-color", "oklch(0 0 0 / 0.5)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklch(20% 10 10deg 10)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "oklch(20% 10 10deg 10 / 0.5)") is "rgba(0, 0, 0, 0)"
PASS computedStyle("background-color", "color(oklch 20% 0 10 / 50%)") is "rgba(0, 0, 0, 0)"
PASS successfullyParsed is true
TEST COMPLETE