From 5808eff1f42c29eb21e28a1f390f290e84313e61 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 7 Aug 2025 12:01:58 +0100 Subject: [PATCH] LibWeb/CSS: Hyphenate request-url-modifier names Corresponds to https://github.com/w3c/csswg-drafts/commit/e1bf92d49ad8c5e8e4522d9838911e64a962e817 Also update our imported WPT tests. --- Libraries/LibWeb/CSS/Parser/ValueParsing.cpp | 10 ++--- Libraries/LibWeb/CSS/URL.cpp | 4 +- .../url-request-modifiers-computed.sub.txt | 40 ++++++++--------- .../url-request-modifiers-invalid.sub.txt | 44 ++++++++++--------- .../url-request-modifiers-serialize.sub.txt | 40 ++++++++--------- .../url-request-modifiers-computed.sub.html | 44 +++++++++---------- .../url-request-modifiers-invalid.sub.html | 42 ++++++++++-------- .../url-request-modifiers-serialize.sub.html | 44 +++++++++---------- 8 files changed, 137 insertions(+), 131 deletions(-) diff --git a/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp b/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp index 0acb5c586e1..16288d1f342 100644 --- a/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp @@ -3049,17 +3049,17 @@ Optional Parser::parse_url_function(TokenStream& tokens) // NB: Currently is the only kind of // https://drafts.csswg.org/css-values-5/#request-url-modifiers - // = | | + // = | | Vector request_url_modifiers; // AD-HOC: This isn't mentioned in the spec, but WPT expects modifiers to be unique (one per type). // Spec issue: https://github.com/w3c/csswg-drafts/issues/12151 while (url_tokens.has_next_token()) { auto& modifier_token = url_tokens.consume_a_token(); - if (modifier_token.is_function("crossorigin"sv)) { + if (modifier_token.is_function("cross-origin"sv)) { // Reject duplicates if (request_url_modifiers.first_matching([](auto& modifier) { return modifier.type() == RequestURLModifier::Type::CrossOrigin; }).has_value()) return {}; - // = crossorigin(anonymous | use-credentials) + // = cross-origin(anonymous | use-credentials) TokenStream modifier_tokens { modifier_token.function().value }; modifier_tokens.discard_whitespace(); if (!modifier_tokens.next_token().is(Token::Type::Ident)) @@ -3085,12 +3085,12 @@ Optional Parser::parse_url_function(TokenStream& tokens) if (!maybe_string.is(Token::Type::String) || modifier_tokens.has_next_token()) return {}; request_url_modifiers.append(RequestURLModifier::create_integrity(maybe_string.token().string())); - } else if (modifier_token.is_function("referrerpolicy"sv)) { + } else if (modifier_token.is_function("referrer-policy"sv)) { // Reject duplicates if (request_url_modifiers.first_matching([](auto& modifier) { return modifier.type() == RequestURLModifier::Type::ReferrerPolicy; }).has_value()) return {}; - // = (no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) + // = (no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) TokenStream modifier_tokens { modifier_token.function().value }; modifier_tokens.discard_whitespace(); if (!modifier_tokens.next_token().is(Token::Type::Ident)) diff --git a/Libraries/LibWeb/CSS/URL.cpp b/Libraries/LibWeb/CSS/URL.cpp index 516f8422fab..21a26ce0d2b 100644 --- a/Libraries/LibWeb/CSS/URL.cpp +++ b/Libraries/LibWeb/CSS/URL.cpp @@ -130,11 +130,11 @@ String RequestURLModifier::to_string() const { switch (m_type) { case Type::CrossOrigin: - return MUST(String::formatted("crossorigin({})", CSS::to_string(m_value.get()))); + return MUST(String::formatted("cross-origin({})", CSS::to_string(m_value.get()))); case Type::Integrity: return MUST(String::formatted("integrity({})", serialize_a_string(m_value.get()))); case Type::ReferrerPolicy: - return MUST(String::formatted("referrerpolicy({})", CSS::to_string(m_value.get()))); + return MUST(String::formatted("referrer-policy({})", CSS::to_string(m_value.get()))); } VERIFY_NOT_REACHED(); } diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.txt index d8423a8f020..b6a708fd50a 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.txt @@ -4,25 +4,25 @@ Found 23 tests 23 Pass Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png")' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(use-credentials))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(use-credentials))' Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar"))' Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(""))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer-when-downgrade))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(same-origin))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin-when-cross-origin))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin-when-cross-origin))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(unsafe-url))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar"))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") crossorigin(anonymous))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar"))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) referrerpolicy(no-referrer))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer) crossorigin(anonymous))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous) integrity("sha384-foobar"))' -Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar") crossorigin(anonymous))' \ No newline at end of file +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer-when-downgrade))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(same-origin))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(origin))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(strict-origin))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(origin-when-cross-origin))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(strict-origin-when-cross-origin))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(unsafe-url))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") cross-origin(anonymous))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar"))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer) cross-origin(anonymous))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous) integrity("sha384-foobar"))' +Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar") cross-origin(anonymous))' \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.txt index 56cd6750bf8..808a0e35152 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.txt @@ -1,17 +1,17 @@ Harness status: OK -Found 29 tests +Found 31 tests -29 Pass -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin())" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(,))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous,))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(,anonymous))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous foobar))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) cross-origin(anonymous))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) cross-origin(use-credentials))" should not set the property value -Pass e.style['background-image'] = "url(crossorigin(anonymous) \"http://wpt.live:80/css/support/1x1-green.png\")" should not set the property value -Pass e.style['background-image'] = "\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous)" should not set the property value +31 Pass +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin())" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(,))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous,))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(,anonymous))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous foobar))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous) cross-origin(anonymous))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous) cross-origin(use-credentials))" should not set the property value +Pass e.style['background-image'] = "url(cross-origin(anonymous) \"http://wpt.live:80/css/support/1x1-green.png\")" should not set the property value +Pass e.style['background-image'] = "\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous)" should not set the property value Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity())" should not set the property value Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(,))" should not set the property value Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\",))" should not set the property value @@ -22,13 +22,15 @@ Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-gre Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") integrity(\"sha384-barbaz\"))" should not set the property value Pass e.style['background-image'] = "url(integrity(\"sha384-foobar\") \"http://wpt.live:80/css/support/1x1-green.png\")" should not set the property value Pass e.style['background-image'] = "\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\")" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy())" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(,))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer,))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(,no-referrer))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer foobar))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer same-origin))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) referrerpolicy(no-referrer))" should not set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) referrerpolicy(same-origin))" should not set the property value -Pass e.style['background-image'] = "url(referrerpolicy(no-referrer) \"http://wpt.live:80/css/support/1x1-green.png\")" should not set the property value -Pass e.style['background-image'] = "\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer)" should not set the property value \ No newline at end of file +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy())" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(,))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer,))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(,no-referrer))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer foobar))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer same-origin))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer) referrer-policy(no-referrer))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer) referrer-policy(same-origin))" should not set the property value +Pass e.style['background-image'] = "url(referrer-policy(no-referrer) \"http://wpt.live:80/css/support/1x1-green.png\")" should not set the property value +Pass e.style['background-image'] = "\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer)" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous))" should not set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer))" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.txt index 2d08e7cbb48..001e3bbfc88 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.txt @@ -4,25 +4,25 @@ Found 23 tests 23 Pass Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\")" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(use-credentials))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(use-credentials))" should set the property value Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\"))" should set the property value Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"\"))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer-when-downgrade))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(same-origin))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(origin))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(strict-origin))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(origin-when-cross-origin))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(strict-origin-when-cross-origin))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(unsafe-url))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) integrity(\"sha384-foobar\"))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") crossorigin(anonymous))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") referrerpolicy(no-referrer))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) integrity(\"sha384-foobar\"))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) referrerpolicy(no-referrer))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) crossorigin(anonymous))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) integrity(\"sha384-foobar\") referrerpolicy(no-referrer))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") referrerpolicy(no-referrer) crossorigin(anonymous))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) crossorigin(anonymous) integrity(\"sha384-foobar\"))" should set the property value -Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) integrity(\"sha384-foobar\") crossorigin(anonymous))" should set the property value \ No newline at end of file +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer-when-downgrade))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(same-origin))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(origin))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(strict-origin))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(origin-when-cross-origin))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(strict-origin-when-cross-origin))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(unsafe-url))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous) integrity(\"sha384-foobar\"))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") cross-origin(anonymous))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") referrer-policy(no-referrer))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer) integrity(\"sha384-foobar\"))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous) referrer-policy(no-referrer))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer) cross-origin(anonymous))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" cross-origin(anonymous) integrity(\"sha384-foobar\") referrer-policy(no-referrer))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") referrer-policy(no-referrer) cross-origin(anonymous))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer) cross-origin(anonymous) integrity(\"sha384-foobar\"))" should set the property value +Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrer-policy(no-referrer) integrity(\"sha384-foobar\") cross-origin(anonymous))" should set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.html b/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.html index 5d5a9e1017f..7cf36422206 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-computed.sub.html @@ -12,34 +12,34 @@ // No modifiers test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png")'); -// = crossorigin(anonymous | use-credentials) -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(use-credentials))'); +// = cross-origin(anonymous | use-credentials) +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(use-credentials))'); // = integrity() test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar"))'); test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(""))'); -// = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer-when-downgrade))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(same-origin))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin-when-cross-origin))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin-when-cross-origin))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(unsafe-url))'); +// = referrer-policy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer-when-downgrade))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(same-origin))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(origin))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(strict-origin))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(origin-when-cross-origin))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(strict-origin-when-cross-origin))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(unsafe-url))'); // Multiple modifiers -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar"))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar"))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer) crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar") crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer) cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar") cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.html b/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.html index a32c2b7159e..8d198e03085 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-invalid.sub.html @@ -6,15 +6,15 @@ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.html b/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.html index 4ea2b46a9c8..f4d72529812 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-values/urls/url-request-modifiers-serialize.sub.html @@ -10,34 +10,34 @@ // No modifiers test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png")'); -// = crossorigin(anonymous | use-credentials) -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(use-credentials))'); +// = cross-origin(anonymous | use-credentials) +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(use-credentials))'); // = integrity() test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar"))'); test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(""))'); -// = referrerpolicy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer-when-downgrade))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(same-origin))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin-when-cross-origin))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin-when-cross-origin))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(unsafe-url))'); +// = referrer-policy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer-when-downgrade))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(same-origin))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(origin))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(strict-origin))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(origin-when-cross-origin))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(strict-origin-when-cross-origin))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(unsafe-url))'); // Multiple modifiers -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar"))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar"))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer) crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); -test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar") crossorigin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer) cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous) integrity("sha384-foobar"))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); +test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar") cross-origin(anonymous))', 'url("http://wpt.live:80/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))');