Skip to content

Commit ea0b8cc

Browse files
dumbmoronchromium-wpt-export-bot
authored andcommitted
[wpt] Test parsing unquoted urls inside url() with modifiers
It seems like none of the current WPTs seem to cover enforcing: "Note: A <url> that is either unquoted or not wrapped in url() notation cannot accept any <url-modifier>s." - https://drafts.csswg.org/css-values-4/#url-modifiers The definition itself also confirms this: <url()> = url( <string> <url-modifier>* ) | <url-token> Let's fix that. Bug: 435625756 Change-Id: I3946817c7d1d329938118076c971d3f553d6f3b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7762048 Reviewed-by: Fredrik Söderquist <[email protected]> Commit-Queue: jj <[email protected]> Cr-Commit-Position: refs/heads/main@{#1615119}
1 parent 0014151 commit ea0b8cc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

css/css-values/urls/url-request-modifiers-invalid.sub.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,11 @@
4242
test_invalid_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" crossorigin(anonymous))');
4343
test_invalid_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrerpolicy(no-referrer))');
4444

45+
// "A <url> that is either unquoted or not wrapped in url() notation
46+
// cannot accept any <url-modifier>s."
47+
// https://drafts.csswg.org/css-values-4/#url-modifiers
48+
test_invalid_value('background-image', 'url(http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png cross-origin(anonymous))');
49+
test_invalid_value('background-image', 'url(http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png integrity("sha384-foobar"))');
50+
test_invalid_value('background-image', 'url(http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png referrer-policy(no-referrer))');
51+
4552
</script>

0 commit comments

Comments
 (0)