Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4'

This commit is contained in:
WPT Sync Bot 2022-01-20 04:38:55 +00:00 committed by cybai
parent 4401622eb1
commit b77ad115f6
16832 changed files with 270819 additions and 87621 deletions

View file

@ -7,10 +7,12 @@
<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>
@ -30,7 +32,8 @@ for (let id of ids) {
test(function() {
const el = document.getElementById(id);
const style = window.getComputedStyle(el);
assert_equals(style["background-image"], 'url("about:invalid")');
assert_equals(style["background-image"], 'url("")');
assert_equals(style["cursor"], 'url(""), pointer');
}, "empty URL: " + id);
}
</script>

View file

@ -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>

View file

@ -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://{{hosts[alt][www]}}">
<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>

View file

@ -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>

View file

@ -1,7 +1,9 @@
#external-unquoted {
background-image: url();
cursor: url(), pointer;
}
#external-quoted {
background-image: url("");
cursor: url(""), pointer;
}

View file

@ -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);
}

View file

@ -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);
}