mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
Tests: Import some URL-related WPT tests
This commit is contained in:
parent
a1fb34d7f2
commit
09b508d8e8
Notes:
github-actions[bot]
2025-05-03 22:23:47 +00:00
Author: https://github.com/AtkinsSJ
Commit: 09b508d8e8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4569
Reviewed-by: https://github.com/tcl3 ✅
18 changed files with 462 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
.test {
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Test passes if there is a green square.</p>
|
||||||
|
<div class="test"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,9 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 4 tests
|
||||||
|
|
||||||
|
4 Pass
|
||||||
|
Pass empty URL: inline-unquoted
|
||||||
|
Pass empty URL: inline-quoted
|
||||||
|
Pass empty URL: external-unquoted
|
||||||
|
Pass empty URL: external-quoted
|
|
@ -0,0 +1,10 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 5 tests
|
||||||
|
|
||||||
|
5 Fail
|
||||||
|
Fail empty URL: inline-unquoted
|
||||||
|
Fail empty URL: inline-quoted
|
||||||
|
Fail empty URL: external-unquoted
|
||||||
|
Fail empty URL: external-quoted
|
||||||
|
Fail empty URL: external-variable
|
|
@ -0,0 +1,7 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 2 tests
|
||||||
|
|
||||||
|
2 Fail
|
||||||
|
Fail base-relative URL: relative-image-url
|
||||||
|
Fail base-relative URL: relative-image-variable-url
|
|
@ -0,0 +1,8 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 3 tests
|
||||||
|
|
||||||
|
3 Fail
|
||||||
|
Fail stylesheet-relative URL: stylesheet-relative-image
|
||||||
|
Fail stylesheet-relative URL: stylesheet-relative-variable-image
|
||||||
|
Fail stylesheet-relative URL: stylesheet-relative-document-variable-image
|
|
@ -0,0 +1,29 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 23 tests
|
||||||
|
|
||||||
|
1 Pass
|
||||||
|
22 Fail
|
||||||
|
Pass Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png")'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(use-credentials))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar"))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(""))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer-when-downgrade))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(same-origin))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(origin-when-cross-origin))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(strict-origin-when-cross-origin))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(unsafe-url))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar"))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") crossorigin(anonymous))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar"))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) referrerpolicy(no-referrer))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) integrity("sha384-foobar") referrerpolicy(no-referrer))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") referrerpolicy(no-referrer) crossorigin(anonymous))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) crossorigin(anonymous) integrity("sha384-foobar"))'
|
||||||
|
Fail Property background-image value 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) integrity("sha384-foobar") crossorigin(anonymous))'
|
|
@ -0,0 +1,35 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 29 tests
|
||||||
|
|
||||||
|
6 Pass
|
||||||
|
23 Fail
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin())" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(,))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous,))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(,anonymous))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous foobar))" should not set the property value
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity())" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(,))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\",))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(,\"sha384-foobar\"))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\" foobar))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(sha384-foobar))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") integrity(\"sha384-foobar\"))" should not set the property value
|
||||||
|
Fail 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
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy())" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(,))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer,))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(,no-referrer))" should not set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer foobar))" should not set the property value
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
|
@ -0,0 +1,29 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 23 tests
|
||||||
|
|
||||||
|
1 Pass
|
||||||
|
22 Fail
|
||||||
|
Pass e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\")" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(use-credentials))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\"))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"\"))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer-when-downgrade))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(same-origin))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(origin))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(strict-origin))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(origin-when-cross-origin))" should set the property value
|
||||||
|
Fail 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
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(unsafe-url))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) integrity(\"sha384-foobar\"))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" integrity(\"sha384-foobar\") crossorigin(anonymous))" should set the property value
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" crossorigin(anonymous) referrerpolicy(no-referrer))" should set the property value
|
||||||
|
Fail e.style['background-image'] = "url(\"http://wpt.live:80/css/support/1x1-green.png\" referrerpolicy(no-referrer) crossorigin(anonymous))" should set the property value
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
||||||
|
Fail 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
|
|
@ -0,0 +1,39 @@
|
||||||
|
<!doctype html>
|
||||||
|
<title>Empty URLs behaviour</title>
|
||||||
|
<link rel=help href=https://drafts.csswg.org/css-values/#url-empty>
|
||||||
|
<link rel=help href=https://github.com/w3c/csswg-drafts/issues/2211#issuecomment-365677844>
|
||||||
|
<script src=../../../resources/testharness.js></script>
|
||||||
|
<script src=../../../resources/testharnessreport.js></script>
|
||||||
|
<style>
|
||||||
|
#inline-unquoted {
|
||||||
|
background-image: url();
|
||||||
|
cursor: url(), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inline-quoted {
|
||||||
|
background-image: url("");
|
||||||
|
cursor: url(""), pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel=stylesheet href=support/empty-urls.css>
|
||||||
|
<div id="inline-unquoted"></div>
|
||||||
|
<div id="inline-quoted"></div>
|
||||||
|
<div id="external-unquoted"></div>
|
||||||
|
<div id="external-quoted"></div>
|
||||||
|
<script>
|
||||||
|
const ids = [
|
||||||
|
"inline-unquoted",
|
||||||
|
"inline-quoted",
|
||||||
|
"external-unquoted",
|
||||||
|
"external-quoted"
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let id of ids) {
|
||||||
|
test(function() {
|
||||||
|
const el = document.getElementById(id);
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
assert_equals(style["background-image"], 'url("")');
|
||||||
|
assert_equals(style["cursor"], 'url(""), pointer');
|
||||||
|
}, "empty URL: " + id);
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,40 @@
|
||||||
|
<!doctype html>
|
||||||
|
<title>Fragment-on URLs behaviour</title>
|
||||||
|
<link rel=help href=https://drafts.csswg.org/css-values/#local-urls>
|
||||||
|
<script src=../../../resources/testharness.js></script>
|
||||||
|
<script src=../../../resources/testharnessreport.js></script>
|
||||||
|
<style>
|
||||||
|
#inline-unquoted {
|
||||||
|
background-image: url(#foo);
|
||||||
|
cursor: url(#foo), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inline-quoted {
|
||||||
|
background-image: url("#foo");
|
||||||
|
cursor: url("#foo"), pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel=stylesheet href=support/fragment-only-urls.css>
|
||||||
|
<div id="inline-unquoted"></div>
|
||||||
|
<div id="inline-quoted"></div>
|
||||||
|
<div id="external-unquoted"></div>
|
||||||
|
<div id="external-quoted"></div>
|
||||||
|
<div id="external-variable"></div>
|
||||||
|
<script>
|
||||||
|
const ids = [
|
||||||
|
"inline-unquoted",
|
||||||
|
"inline-quoted",
|
||||||
|
"external-unquoted",
|
||||||
|
"external-quoted",
|
||||||
|
"external-variable",
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let id of ids) {
|
||||||
|
test(function() {
|
||||||
|
const el = document.getElementById(id);
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
assert_equals(style["background-image"], 'url("#foo")');
|
||||||
|
assert_equals(style["cursor"], 'url("#foo"), pointer');
|
||||||
|
}, "empty URL: " + id);
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!doctype html>
|
||||||
|
<title>URLs in embedded style sheets resolve relative to the document base URI</title>
|
||||||
|
<link rel=help href=https://drafts.csswg.org/css-values/#relative-urls>
|
||||||
|
<script src=../../../resources/testharness.js></script>
|
||||||
|
<script src=../../../resources/testharnessreport.js></script>
|
||||||
|
<base href="http://www.not-wpt.live">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--image-path: url("images/test.png");
|
||||||
|
}
|
||||||
|
#relative-image-url {
|
||||||
|
background-image: url(images/test.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
#relative-image-variable-url {
|
||||||
|
background-image: var(--image-path);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="relative-image-url"></div>
|
||||||
|
<div id="relative-image-variable-url"></div>
|
||||||
|
<script>
|
||||||
|
const ids = [
|
||||||
|
"relative-image-url",
|
||||||
|
"relative-image-variable-url"
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let id of ids) {
|
||||||
|
test(() => {
|
||||||
|
const el = document.getElementById(id);
|
||||||
|
const backgroundImageStyle = window.getComputedStyle(el)["background-image"];
|
||||||
|
const baseRelativeImageURL = new URL("images/test.png", document.baseURI);
|
||||||
|
assert_equals(backgroundImageStyle, `url("${baseRelativeImageURL.href}")`);
|
||||||
|
}, "base-relative URL: " + id);
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<!doctype html>
|
||||||
|
<title>URLs in a stylesheet resolve relative to the stylesheet</title>
|
||||||
|
<link rel=help href=https://drafts.csswg.org/css-values/#relative-urls>
|
||||||
|
<script src=../../../resources/testharness.js></script>
|
||||||
|
<script src=../../../resources/testharnessreport.js></script>
|
||||||
|
<link id="stylesheet" rel=stylesheet href=support/relative-urls.css>
|
||||||
|
<div id="stylesheet-relative-image"></div>
|
||||||
|
<div id="stylesheet-relative-variable-image"></div>
|
||||||
|
<div id="stylesheet-relative-document-variable-image"></div>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--image-path-document: url("images/test.png");
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
const ids = [
|
||||||
|
"stylesheet-relative-image",
|
||||||
|
"stylesheet-relative-variable-image",
|
||||||
|
"stylesheet-relative-document-variable-image",
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let id of ids) {
|
||||||
|
test(() => {
|
||||||
|
const el = document.getElementById(id);
|
||||||
|
const backgroundImageStyle = window.getComputedStyle(el)["background-image"];
|
||||||
|
|
||||||
|
const stylesheet = document.getElementById("stylesheet");
|
||||||
|
const sheetRelativeImageURL = new URL("images/test.png", stylesheet.href);
|
||||||
|
|
||||||
|
assert_equals(backgroundImageStyle, `url("${sheetRelativeImageURL.href}")`);
|
||||||
|
}, "stylesheet-relative URL: " + id);
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,9 @@
|
||||||
|
#external-unquoted {
|
||||||
|
background-image: url();
|
||||||
|
cursor: url(), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#external-quoted {
|
||||||
|
background-image: url("");
|
||||||
|
cursor: url(""), pointer;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
:root {
|
||||||
|
--fragment-image-url: url("#foo");
|
||||||
|
--fragment-cursor-url: url("#foo"), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#external-unquoted {
|
||||||
|
background-image: url(#foo);
|
||||||
|
cursor: url(#foo), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#external-quoted {
|
||||||
|
background-image: url("#foo");
|
||||||
|
cursor: url("#foo"), pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#external-variable {
|
||||||
|
background-image: var(--fragment-image-url);
|
||||||
|
cursor: var(--fragment-cursor-url);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
:root {
|
||||||
|
--image-path-stylesheet: url("images/test.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
#stylesheet-relative-image {
|
||||||
|
background-image: url(images/test.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
#stylesheet-relative-variable-image {
|
||||||
|
background-image: var(--image-path-stylesheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
#stylesheet-relative-document-variable-image {
|
||||||
|
background-image: var(--image-path-document);
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-values-5/#request-url-modifiers">
|
||||||
|
<link rel="author" title="Sam Weinig" href="mailto:weinig@webkit.org">
|
||||||
|
<script src="../../../resources/testharness.js"></script>
|
||||||
|
<script src="../../../resources/testharnessreport.js"></script>
|
||||||
|
<script src="../../../css/support/computed-testcommon.js"></script>
|
||||||
|
<div id="container" style="font-size: 20">
|
||||||
|
<div id="target"></div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// No modifiers
|
||||||
|
test_computed_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png")');
|
||||||
|
|
||||||
|
// <crossorigin-modifier> = 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))');
|
||||||
|
|
||||||
|
// <integrity-modifier> = integrity(<string>)
|
||||||
|
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-modifier> = 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))');
|
||||||
|
|
||||||
|
// 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))');
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-values-5/#request-url-modifiers">
|
||||||
|
<link rel="author" title="Sam Weinig" href="mailto:weinig@webkit.org">
|
||||||
|
<script src="../../../resources/testharness.js"></script>
|
||||||
|
<script src="../../../resources/testharnessreport.js"></script>
|
||||||
|
<script src="../../../css/support/parsing-testcommon.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin())');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(,))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous,))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(,anonymous))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous foobar))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) cross-origin(anonymous))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous) cross-origin(use-credentials))');
|
||||||
|
test_invalid_value('background-image', 'url(crossorigin(anonymous) "http://wpt.live:80/css/support/1x1-green.png")');
|
||||||
|
test_invalid_value('background-image', '"http://wpt.live:80/css/support/1x1-green.png" crossorigin(anonymous)');
|
||||||
|
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity())');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(,))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar",))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(,"sha384-foobar"))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar" foobar))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity(sha384-foobar))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") integrity("sha384-foobar"))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar") integrity("sha384-barbaz"))');
|
||||||
|
test_invalid_value('background-image', 'url(integrity("sha384-foobar") "http://wpt.live:80/css/support/1x1-green.png")');
|
||||||
|
test_invalid_value('background-image', '"http://wpt.live:80/css/support/1x1-green.png" integrity("sha384-foobar")');
|
||||||
|
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy())');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(,))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer,))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(,no-referrer))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer foobar))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer same-origin))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) referrerpolicy(no-referrer))');
|
||||||
|
test_invalid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer) referrerpolicy(same-origin))');
|
||||||
|
test_invalid_value('background-image', 'url(referrerpolicy(no-referrer) "http://wpt.live:80/css/support/1x1-green.png")');
|
||||||
|
test_invalid_value('background-image', '"http://wpt.live:80/css/support/1x1-green.png" referrerpolicy(no-referrer)');
|
||||||
|
|
||||||
|
</script>
|
|
@ -0,0 +1,43 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-values-5/#request-url-modifiers">
|
||||||
|
<link rel="author" title="Sam Weinig" href="mailto:weinig@webkit.org">
|
||||||
|
<script src="../../../resources/testharness.js"></script>
|
||||||
|
<script src="../../../resources/testharnessreport.js"></script>
|
||||||
|
<script src="../../../css/support/parsing-testcommon.js"></script>
|
||||||
|
<div id=target></div>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// No modifiers
|
||||||
|
test_valid_value('background-image', 'url("http://wpt.live:80/css/support/1x1-green.png")');
|
||||||
|
|
||||||
|
// <crossorigin-modifier> = 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))');
|
||||||
|
|
||||||
|
// <integrity-modifier> = integrity(<string>)
|
||||||
|
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-modifier> = 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))');
|
||||||
|
|
||||||
|
// 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))');
|
||||||
|
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue