From 9a275155c9f48874b0ea9cf2d36781e3649755d8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 25 Apr 2026 07:23:33 +0200 Subject: [PATCH] Tests: Import CSS image-set parsing WPT Import the CSS Images image-set parsing WPT with the current expectations so parser support can be landed against a focused baseline. --- .../image-set/image-set-parsing.txt | 150 ++++++++ .../image-set/image-set-parsing.html | 345 ++++++++++++++++++ 2 files changed, 495 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-images/image-set/image-set-parsing.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-images/image-set/image-set-parsing.html diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-images/image-set/image-set-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-images/image-set/image-set-parsing.txt new file mode 100644 index 00000000000..4d027ce5dec --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-images/image-set/image-set-parsing.txt @@ -0,0 +1,150 @@ +Harness status: OK + +Found 144 tests + +48 Pass +96 Fail +Fail e.style['background-image'] = "image-set(url(example.png) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(example.png) 1x)" should set the property value +Fail e.style['background-image'] = "image-set('example.jpg' 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set('example.jpg' 1x)" should set the property value +Fail e.style['background-image'] = "image-set(url(example.png) 1x, 'example.png' 2x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(example.png) 1x, 'example.png' 2x)" should set the property value +Fail e.style['background-image'] = "image-set(url(example.png) 1dpcm, 'example.png' 2x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(example.png) 1dpcm, 'example.png' 2x)" should set the property value +Fail e.style['background-image'] = "image-set('example.jpeg' 222dpi, url(example.png) 3.5x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set('example.jpeg' 222dpi, url(example.png) 3.5x)" should set the property value +Fail e.style['content'] = "image-set(url(\"example.png\") 1x)" should set the property value +Fail e.style['content'] = "-webkit-image-set(url(\"example.png\") 1x)" should set the property value +Fail e.style['content'] = "image-set(url(\"example.png\") 1x, \"example.png\" 3x)" should set the property value +Fail e.style['content'] = "-webkit-image-set(url(\"example.png\") 1x, \"example.png\" 3x)" should set the property value +Fail e.style['border-image-source'] = "image-set(url(\"example.png\") 1x)" should set the property value +Fail e.style['border-image-source'] = "-webkit-image-set(url(\"example.png\") 1x)" should set the property value +Fail e.style['border-image-source'] = "image-set(url(\"example.png\") 1x, \"example.png\" 3x)" should set the property value +Fail e.style['border-image-source'] = "-webkit-image-set(url(\"example.png\") 1x, \"example.png\" 3x)" should set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") -20x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -20x)" should not set the property value +Pass e.style['background-image'] = "image-set(none, url(example.png) 1x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(none, url(example.png) 1x)" should not set the property value +Pass e.style['background-image'] = "image-set()" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set()" should not set the property value +Pass e.style['background-image'] = "image-set('example.jpeg' 92pid url(example.png) 1x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set('example.jpeg' 92pid url(example.png) 1x)" should not set the property value +Pass e.style['background-image'] = "image-set(url(example.png) 1x url(example.jpeg))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) 1x url(example.jpeg))" should not set the property value +Pass e.style['background-image'] = "image-set(url(example.png) 1x 2x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) 1x 2x)" should not set the property value +Fail e.style['background-image'] = "image-set(url(foo))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(foo))" should set the property value +Fail e.style['background-image'] = "image-set(url(foo), url(bar) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(foo), url(bar) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(url(foo) 1x, url(bar))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(foo) 1x, url(bar))" should set the property value +Fail e.style['background-image'] = "image-set(url(foo), url(bar))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(foo), url(bar))" should set the property value +Fail e.style['background-image'] = "image-set(url(foo) 1x, url(bar), url(baz) 2x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(foo) 1x, url(bar), url(baz) 2x)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1x)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(2x * 3))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(2x * 3))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 1dppx)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1dppx)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(1dppx * 1))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1dppx * 1))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 1dpi)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1dpi)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(96dpi * 2))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(96dpi * 2))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 1dpcm)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1dpcm)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(1dpcm * 96/2.54))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1dpcm * 96/2.54))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 1x, url(\"example.png\") 2dppx, \"example.png\" 250dpi, \"example.png\" 1dpcm)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1x, url(\"example.png\") 2dppx, \"example.png\" 250dpi, \"example.png\" 1dpcm)" should set the property value +Fail e.style['content'] = "image-set(url(\"example.png\") 1dpi)" should set the property value +Fail e.style['content'] = "-webkit-image-set(url(\"example.png\") 1dpi)" should set the property value +Fail e.style['content'] = "image-set(url(\"example.png\") calc(1 * 96dpi))" should set the property value +Fail e.style['content'] = "-webkit-image-set(url(\"example.png\") calc(1 * 96dpi))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(1dppx * sibling-index()))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1dppx * sibling-index()))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(1dppx * sign(1em - 10px)))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1dppx * sign(1em - 10px)))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(1dppx * sign(10px)))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1dppx * sign(10px)))" should set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") 1invalidResUnit)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1invalidResUnit)" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") calc(3 * 4))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(3 * 4))" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") calc(2 - 1))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(2 - 1))" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") calc(2x - 1))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(2x - 1))" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") calc(1 + 4dpi))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1 + 4dpi))" should not set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 0x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0x)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 0dppx)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dppx)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 0dpi)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dpi)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 0dpcm)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 0dpcm)" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(-1 * 1x))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(-1 * 1x))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") calc(1x + -1x))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") calc(1x + -1x))" should set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") -1x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -1x)" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") -3dppx)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -3dppx)" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") -96dpi)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -96dpi)" should not set the property value +Pass e.style['background-image'] = "image-set(url(\"example.png\") -113dpcm)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(\"example.png\") -113dpcm)" should not set the property value +Fail e.style['background-image'] = "image-set(linear-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(linear-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(repeating-linear-gradient(red, blue 25%) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(repeating-linear-gradient(red, blue 25%) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(radial-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(radial-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(repeating-radial-gradient(red, blue 25%) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(repeating-radial-gradient(red, blue 25%) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(conic-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(conic-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(repeating-conic-gradient(red, blue 25%) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(repeating-conic-gradient(red, blue 25%) 1x)" should set the property value +Fail e.style['content'] = "image-set(linear-gradient(black, white) 1x, url(\"example.png\") 4x)" should set the property value +Fail e.style['content'] = "-webkit-image-set(linear-gradient(black, white) 1x, url(\"example.png\") 4x)" should set the property value +Fail e.style['content'] = "image-set(url(\"example.png\") 192dpi, linear-gradient(black, white) 1x)" should set the property value +Fail e.style['content'] = "-webkit-image-set(url(\"example.png\") 192dpi, linear-gradient(black, white) 1x)" should set the property value +Fail e.style['background-image'] = "image-set(linear-gradient(red) 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(linear-gradient(red) 1x)" should set the property value +Pass e.style['cursor'] = "image-set(linear-gradient(black, white) 1x)" should not set the property value +Pass e.style['cursor'] = "-webkit-image-set(linear-gradient(black, white) 1x)" should not set the property value +Fail e.style['background-image'] = "image-set(url(\"example.png\") 1x type(\"image/png\"))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"example.png\") 1x type(\"image/png\"))" should set the property value +Fail e.style['background-image'] = "image-set(url(example.png) type('image/png'))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(example.png) type('image/png'))" should set the property value +Fail e.style['background-image'] = "image-set(url(example.png) type('image/png') 1x)" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(example.png) type('image/png') 1x)" should set the property value +Fail e.style['background-image'] = "image-set(url(example.png) 1x type('image/jpeg'))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(example.png) 1x type('image/jpeg'))" should set the property value +Fail e.style['background-image'] = "image-set(url(\"x\") 1x type(\"a\\\"\"))" should set the property value +Fail e.style['background-image'] = "-webkit-image-set(url(\"x\") 1x type(\"a\\\"\"))" should set the property value +Pass e.style['background-image'] = "image-set(url(example.png) type(image/png))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) type(image/png))" should not set the property value +Pass e.style['background-image'] = "image-set(url(example.png) type('image/png') type('image/png'))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) type('image/png') type('image/png'))" should not set the property value +Pass e.style['background-image'] = "image-set(url(example.png) type('image/png' 'image/png'))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) type('image/png' 'image/png'))" should not set the property value +Pass e.style['background-image'] = "image-set(url(example.png) type(url('image/png')))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) type(url('image/png')))" should not set the property value +Pass e.style['background-image'] = "image-set(url(example.png) 1xtype('image/png'))" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(url(example.png) 1xtype('image/png'))" should not set the property value +Pass e.style['background-image'] = "image-set(type('image/png') url(example.png) 1x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(type('image/png') url(example.png) 1x)" should not set the property value +Pass e.style['background-image'] = "image-set(image-set(url(example.png)) 2x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(image-set(url(example.png)) 2x)" should not set the property value +Pass e.style['background-image'] = "image-set(image(image-set(url(example.png)) 2x) 2x)" should not set the property value +Pass e.style['background-image'] = "-webkit-image-set(image(image-set(url(example.png)) 2x) 2x)" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-images/image-set/image-set-parsing.html b/Tests/LibWeb/Text/input/wpt-import/css/css-images/image-set/image-set-parsing.html new file mode 100644 index 00000000000..ec3a1e9c27a --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-images/image-set/image-set-parsing.html @@ -0,0 +1,345 @@ + +Image set parsing + + + + + + + + +