diff --git a/css/css-color/parsing/color-computed-color-function.html b/css/css-color/parsing/color-computed-color-function.html index e610754c644a4e..530a605bc9292f 100644 --- a/css/css-color/parsing/color-computed-color-function.html +++ b/css/css-color/parsing/color-computed-color-function.html @@ -31,12 +31,6 @@ test_computed_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${colorSpace} 0 0 0 / 0)`); test_computed_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${colorSpace} 0 0 0)`); test_computed_value("color", `color(${colorSpace} 0 0 0 / 300%)`, `color(${colorSpace} 0 0 0)`); - test_computed_value("color", `color(${colorSpace} 50% -200)`, `color(${colorSpace} 0.5 -200 0)`); - test_computed_value("color", `color(${colorSpace} 50%)`, `color(${colorSpace} 0.5 0 0)`); - test_computed_value("color", `color(${colorSpace})`, `color(${colorSpace} 0 0 0)`); - test_computed_value("color", `color(${colorSpace} 50% -200 / 0.5)`, `color(${colorSpace} 0.5 -200 0 / 0.5)`); - test_computed_value("color", `color(${colorSpace} 50% / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`); - test_computed_value("color", `color(${colorSpace} / 0.5)`, `color(${colorSpace} 0 0 0 / 0.5)`); test_computed_value("color", `color(${colorSpace} 200 200 200)`, `color(${colorSpace} 200 200 200)`); test_computed_value("color", `color(${colorSpace} 200 200 200 / 200)`, `color(${colorSpace} 200 200 200)`); test_computed_value("color", `color(${colorSpace} -200 -200 -200)`, `color(${colorSpace} -200 -200 -200)`); @@ -71,12 +65,6 @@ test_computed_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${resultColorSpace} 0 0 0 / 0)`); test_computed_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${resultColorSpace} 0 0 0)`); test_computed_value("color", `color(${colorSpace} 0 0 0 / 300%)`, `color(${resultColorSpace} 0 0 0)`); - test_computed_value("color", `color(${colorSpace} 1 1)`, `color(${resultColorSpace} 1 1 0)`); - test_computed_value("color", `color(${colorSpace} 1)`, `color(${resultColorSpace} 1 0 0)`); - test_computed_value("color", `color(${colorSpace})`, `color(${resultColorSpace} 0 0 0)`); - test_computed_value("color", `color(${colorSpace} 1 1 / .5)`, `color(${resultColorSpace} 1 1 0 / 0.5)`); - test_computed_value("color", `color(${colorSpace} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`); - test_computed_value("color", `color(${colorSpace} / 50%)`, `color(${resultColorSpace} 0 0 0 / 0.5)`); 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)`); test_computed_value("color", `color(${colorSpace} none none none / none)`, `color(${resultColorSpace} none none none / none)`); @@ -276,9 +264,6 @@ test_computed_value("color", "color(srgb 1 1 1 / 0)", "color(srgb 1 1 1 / 0)", "[sRGB white with 0 alpha]"); test_computed_value("color", "color(srgb 1 1 1 / 50%)", "color(srgb 1 1 1 / 0.5)", "[sRGB white with 50% alpha]"); test_computed_value("color", "color(srgb 1 1 1 / 0%)", "color(srgb 1 1 1 / 0)", "[sRGB white with 0% alpha]"); -test_computed_value("color", "color(srgb 1 1)", "color(srgb 1 1 0)", "[One missing component is 0]"); -test_computed_value("color", "color(srgb 1)", "color(srgb 1 0 0)", "[Two missing components are 0]"); -test_computed_value("color", "color(srgb)", "color(srgb 0 0 0)", "[All components missing]"); test_computed_value("color", "color(display-p3 0.6 0.7 0.8)", "color(display-p3 0.6 0.7 0.8)", "[Display P3 color]"); test_computed_value("color", "color(dIspLaY-P3 0.6 0.7 0.8)", "color(display-p3 0.6 0.7 0.8)", "[Different case for Display P3]"); diff --git a/css/css-color/parsing/color-invalid-color-function.html b/css/css-color/parsing/color-invalid-color-function.html index 75d9ff7c21764b..51f393747c19a2 100644 --- a/css/css-color/parsing/color-invalid-color-function.html +++ b/css/css-color/parsing/color-invalid-color-function.html @@ -20,6 +20,13 @@ test_invalid_value("color", `color(${colorSpace} 0% 0 0deg)`); test_invalid_value("color", `color(${colorSpace} 0% 0% 0deg)`); test_invalid_value("color", `color(${colorSpace} 40% 0 0deg)`); + // Missing parameters should not parse + test_invalid_value("color", `color(${colorSpace} 50% -200)`); + test_invalid_value("color", `color(${colorSpace} 50%)`); + test_invalid_value("color", `color(${colorSpace})`); + test_invalid_value("color", `color(${colorSpace} 50% -200 / 0.5)`); + test_invalid_value("color", `color(${colorSpace} 50% / 0.5)`); + test_invalid_value("color", `color(${colorSpace} / 0.5)`); } for (const colorSpace of [ "xyz", "xyz-d50", "xyz-d65" ]) { @@ -30,6 +37,13 @@ test_invalid_value("color", `color(${colorSpace} 0% 0 0deg)`); test_invalid_value("color", `color(${colorSpace} 0% 0% 0deg)`); test_invalid_value("color", `color(${colorSpace} 40% 0 0deg)`); + // Missing parameters should not parse + test_invalid_value("color", `color(${colorSpace} 1 1)`); + test_invalid_value("color", `color(${colorSpace} 1)`); + test_invalid_value("color", `color(${colorSpace})`); + test_invalid_value("color", `color(${colorSpace} 1 1 / .5)`); + test_invalid_value("color", `color(${colorSpace} 1 / 0.5)`); + test_invalid_value("color", `color(${colorSpace} / 50%)`); } test_invalid_value("color", "color()"); // Empty diff --git a/css/css-color/parsing/color-valid-color-function.html b/css/css-color/parsing/color-valid-color-function.html index 79e0bde059013d..1eb7c744b2acee 100644 --- a/css/css-color/parsing/color-valid-color-function.html +++ b/css/css-color/parsing/color-valid-color-function.html @@ -26,12 +26,6 @@ test_valid_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${colorSpace} 0 0 0 / 0)`); test_valid_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${colorSpace} 0 0 0)`); test_valid_value("color", `color(${colorSpace} 0 0 0 / 300%)`, `color(${colorSpace} 0 0 0)`); - test_valid_value("color", `color(${colorSpace} 50% -200)`, `color(${colorSpace} 0.5 -200 0)`); - test_valid_value("color", `color(${colorSpace} 50%)`, `color(${colorSpace} 0.5 0 0)`); - test_valid_value("color", `color(${colorSpace})`, `color(${colorSpace} 0 0 0)`); - test_valid_value("color", `color(${colorSpace} 50% -200 / 0.5)`, `color(${colorSpace} 0.5 -200 0 / 0.5)`); - test_valid_value("color", `color(${colorSpace} 50% / 0.5)`, `color(${colorSpace} 0.5 0 0 / 0.5)`); - test_valid_value("color", `color(${colorSpace} / 0.5)`, `color(${colorSpace} 0 0 0 / 0.5)`); test_valid_value("color", `color(${colorSpace} 200 200 200)`, `color(${colorSpace} 200 200 200)`); test_valid_value("color", `color(${colorSpace} 200 200 200 / 200)`, `color(${colorSpace} 200 200 200)`); test_valid_value("color", `color(${colorSpace} -200 -200 -200)`, `color(${colorSpace} -200 -200 -200)`); @@ -66,12 +60,6 @@ test_valid_value("color", `color(${colorSpace} 0 0 0 / -10%)`, `color(${resultColorSpace} 0 0 0 / 0)`); test_valid_value("color", `color(${colorSpace} 0 0 0 / 110%)`, `color(${resultColorSpace} 0 0 0)`); test_valid_value("color", `color(${colorSpace} 0 0 0 / 300%)`, `color(${resultColorSpace} 0 0 0)`); - test_valid_value("color", `color(${colorSpace} 1 1)`, `color(${resultColorSpace} 1 1 0)`); - test_valid_value("color", `color(${colorSpace} 1)`, `color(${resultColorSpace} 1 0 0)`); - test_valid_value("color", `color(${colorSpace})`, `color(${resultColorSpace} 0 0 0)`); - test_valid_value("color", `color(${colorSpace} 1 1 / .5)`, `color(${resultColorSpace} 1 1 0 / 0.5)`); - test_valid_value("color", `color(${colorSpace} 1 / 0.5)`, `color(${resultColorSpace} 1 0 0 / 0.5)`); - test_valid_value("color", `color(${colorSpace} / 50%)`, `color(${resultColorSpace} 0 0 0 / 0.5)`); 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)`); test_valid_value("color", `color(${colorSpace} none none none / none)`, `color(${resultColorSpace} none none none / none)`);