LibWeb/CSS: Correctly serialize the colorspace name of xyz and xyz-d65

This gives us a +40 subtests passes in:
 - css/css-color/parsing/color-valid-color-function.html
This commit is contained in:
Lucas CHOLLET
2024-12-13 16:50:26 -05:00
committed by Sam Atkins
parent 9240d38273
commit 3c60510896
2 changed files with 43 additions and 43 deletions

View File

@@ -51,7 +51,7 @@ StringView string_view_from_color_type(CSSColorValue::ColorType color_type)
if (color_type == CSSColorValue::ColorType::XYZD50) if (color_type == CSSColorValue::ColorType::XYZD50)
return "xyz-d50"sv; return "xyz-d50"sv;
if (color_type == CSSColorValue::ColorType::XYZD65) if (color_type == CSSColorValue::ColorType::XYZD65)
return "xyz"sv; return "xyz-d65"sv;
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }

View File

@@ -2,8 +2,8 @@ Harness status: OK
Found 306 tests Found 306 tests
140 Pass 180 Pass
166 Fail 126 Fail
Pass e.style['color'] = "color(srgb 0% 0% 0%)" should set the property value Pass e.style['color'] = "color(srgb 0% 0% 0%)" should set the property value
Pass e.style['color'] = "color(srgb 10% 10% 10%)" should set the property value Pass e.style['color'] = "color(srgb 10% 10% 10%)" should set the property value
Pass e.style['color'] = "color(srgb .2 .2 25%)" should set the property value Pass e.style['color'] = "color(srgb .2 .2 25%)" should set the property value
@@ -208,26 +208,26 @@ Fail e.style['color'] = "color(display-p3 calc(NaN) 0 0)" should set the propert
Fail e.style['color'] = "color(display-p3 calc(0 / 0) 0 0)" should set the property value Fail e.style['color'] = "color(display-p3 calc(0 / 0) 0 0)" should set the property value
Fail e.style['color'] = "color(display-p3 calc(50% + (sign(1em - 10px) * 10%)) 0 0 / 0.5)" should set the property value Fail e.style['color'] = "color(display-p3 calc(50% + (sign(1em - 10px) * 10%)) 0 0 / 0.5)" should set the property value
Fail e.style['color'] = "color(display-p3 0.5 0 0 / calc(50% + (sign(1em - 10px) * 10%)))" should set the property value Fail e.style['color'] = "color(display-p3 0.5 0 0 / calc(50% + (sign(1em - 10px) * 10%)))" should set the property value
Fail e.style['color'] = "color(xyz 0% 0% 0%)" should set the property value Pass e.style['color'] = "color(xyz 0% 0% 0%)" should set the property value
Fail e.style['color'] = "color(xyz 10% 10% 10%)" should set the property value Pass e.style['color'] = "color(xyz 10% 10% 10%)" should set the property value
Fail e.style['color'] = "color(xyz .2 .2 25%)" should set the property value Pass e.style['color'] = "color(xyz .2 .2 25%)" should set the property value
Fail e.style['color'] = "color(xyz 0 0 0 / 1)" should set the property value Pass e.style['color'] = "color(xyz 0 0 0 / 1)" should set the property value
Fail e.style['color'] = "color(xyz 0% 0 0 / 0.5)" should set the property value Pass e.style['color'] = "color(xyz 0% 0 0 / 0.5)" should set the property value
Fail e.style['color'] = "color(xyz 20% 0 10/0.5)" should set the property value Pass e.style['color'] = "color(xyz 20% 0 10/0.5)" should set the property value
Fail e.style['color'] = "color(xyz 20% 0 10/50%)" should set the property value Pass e.style['color'] = "color(xyz 20% 0 10/50%)" should set the property value
Fail e.style['color'] = "color(xyz 400% 0 10/50%)" should set the property value Pass e.style['color'] = "color(xyz 400% 0 10/50%)" should set the property value
Fail e.style['color'] = "color(xyz 50% -160 160)" should set the property value Pass e.style['color'] = "color(xyz 50% -160 160)" should set the property value
Fail e.style['color'] = "color(xyz 50% -200 200)" should set the property value Pass e.style['color'] = "color(xyz 50% -200 200)" should set the property value
Fail e.style['color'] = "color(xyz 0 0 0 / -10%)" should set the property value Pass e.style['color'] = "color(xyz 0 0 0 / -10%)" should set the property value
Fail e.style['color'] = "color(xyz 0 0 0 / 110%)" should set the property value Pass e.style['color'] = "color(xyz 0 0 0 / 110%)" should set the property value
Fail e.style['color'] = "color(xyz 0 0 0 / 300%)" should set the property value Pass e.style['color'] = "color(xyz 0 0 0 / 300%)" should set the property value
Fail e.style['color'] = "color(xyz 200 200 200)" should set the property value Pass e.style['color'] = "color(xyz 200 200 200)" should set the property value
Fail e.style['color'] = "color(xyz 200 200 200 / 200)" should set the property value Pass e.style['color'] = "color(xyz 200 200 200 / 200)" should set the property value
Fail e.style['color'] = "color(xyz -200 -200 -200)" should set the property value Pass e.style['color'] = "color(xyz -200 -200 -200)" should set the property value
Fail e.style['color'] = "color(xyz -200 -200 -200 / -200)" should set the property value Pass e.style['color'] = "color(xyz -200 -200 -200 / -200)" should set the property value
Fail e.style['color'] = "color(xyz 200% 200% 200%)" should set the property value Pass e.style['color'] = "color(xyz 200% 200% 200%)" should set the property value
Fail e.style['color'] = "color(xyz 200% 200% 200% / 200%)" should set the property value Pass e.style['color'] = "color(xyz 200% 200% 200% / 200%)" should set the property value
Fail e.style['color'] = "color(xyz -200% -200% -200% / -200%)" should set the property value Pass e.style['color'] = "color(xyz -200% -200% -200% / -200%)" should set the property value
Fail 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 Fail 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
Fail e.style['color'] = "color(xyz calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value Fail e.style['color'] = "color(xyz calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(xyz calc(50%) 50% 0.5)" should set the property value Fail e.style['color'] = "color(xyz calc(50%) 50% 0.5)" should set the property value
@@ -276,26 +276,26 @@ Fail e.style['color'] = "color(xyz-d50 calc(NaN) 0 0)" should set the property v
Fail e.style['color'] = "color(xyz-d50 calc(0 / 0) 0 0)" should set the property value Fail e.style['color'] = "color(xyz-d50 calc(0 / 0) 0 0)" should set the property value
Fail e.style['color'] = "color(xyz-d50 calc(50% + (sign(1em - 10px) * 10%)) 0 0 / 0.5)" should set the property value Fail e.style['color'] = "color(xyz-d50 calc(50% + (sign(1em - 10px) * 10%)) 0 0 / 0.5)" should set the property value
Fail e.style['color'] = "color(xyz-d50 0.5 0 0 / calc(50% + (sign(1em - 10px) * 10%)))" should set the property value Fail e.style['color'] = "color(xyz-d50 0.5 0 0 / calc(50% + (sign(1em - 10px) * 10%)))" should set the property value
Fail e.style['color'] = "color(xyz-d65 0% 0% 0%)" should set the property value Pass e.style['color'] = "color(xyz-d65 0% 0% 0%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 10% 10% 10%)" should set the property value Pass e.style['color'] = "color(xyz-d65 10% 10% 10%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 .2 .2 25%)" should set the property value Pass e.style['color'] = "color(xyz-d65 .2 .2 25%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 0 0 0 / 1)" should set the property value Pass e.style['color'] = "color(xyz-d65 0 0 0 / 1)" should set the property value
Fail e.style['color'] = "color(xyz-d65 0% 0 0 / 0.5)" should set the property value Pass e.style['color'] = "color(xyz-d65 0% 0 0 / 0.5)" should set the property value
Fail e.style['color'] = "color(xyz-d65 20% 0 10/0.5)" should set the property value Pass e.style['color'] = "color(xyz-d65 20% 0 10/0.5)" should set the property value
Fail e.style['color'] = "color(xyz-d65 20% 0 10/50%)" should set the property value Pass e.style['color'] = "color(xyz-d65 20% 0 10/50%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 400% 0 10/50%)" should set the property value Pass e.style['color'] = "color(xyz-d65 400% 0 10/50%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 50% -160 160)" should set the property value Pass e.style['color'] = "color(xyz-d65 50% -160 160)" should set the property value
Fail e.style['color'] = "color(xyz-d65 50% -200 200)" should set the property value Pass e.style['color'] = "color(xyz-d65 50% -200 200)" should set the property value
Fail e.style['color'] = "color(xyz-d65 0 0 0 / -10%)" should set the property value Pass e.style['color'] = "color(xyz-d65 0 0 0 / -10%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 0 0 0 / 110%)" should set the property value Pass e.style['color'] = "color(xyz-d65 0 0 0 / 110%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 0 0 0 / 300%)" should set the property value Pass e.style['color'] = "color(xyz-d65 0 0 0 / 300%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 200 200 200)" should set the property value Pass e.style['color'] = "color(xyz-d65 200 200 200)" should set the property value
Fail e.style['color'] = "color(xyz-d65 200 200 200 / 200)" should set the property value Pass e.style['color'] = "color(xyz-d65 200 200 200 / 200)" should set the property value
Fail e.style['color'] = "color(xyz-d65 -200 -200 -200)" should set the property value Pass e.style['color'] = "color(xyz-d65 -200 -200 -200)" should set the property value
Fail e.style['color'] = "color(xyz-d65 -200 -200 -200 / -200)" should set the property value Pass e.style['color'] = "color(xyz-d65 -200 -200 -200 / -200)" should set the property value
Fail e.style['color'] = "color(xyz-d65 200% 200% 200%)" should set the property value Pass e.style['color'] = "color(xyz-d65 200% 200% 200%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 200% 200% 200% / 200%)" should set the property value Pass e.style['color'] = "color(xyz-d65 200% 200% 200% / 200%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 -200% -200% -200% / -200%)" should set the property value Pass e.style['color'] = "color(xyz-d65 -200% -200% -200% / -200%)" should set the property value
Fail 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 Fail 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
Fail e.style['color'] = "color(xyz-d65 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value Fail e.style['color'] = "color(xyz-d65 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(xyz-d65 calc(50%) 50% 0.5)" should set the property value Fail e.style['color'] = "color(xyz-d65 calc(50%) 50% 0.5)" should set the property value