Update web-platform-tests to revision b'1d9b01e2fad6af3a057d571b1e088e15fa9bc8e6'

This commit is contained in:
WPT Sync Bot 2023-04-07 01:27:34 +00:00
parent cfef75c99b
commit bb34f95b33
1683 changed files with 37170 additions and 4252 deletions

View file

@ -0,0 +1,35 @@
<!doctype html>
<meta charset="utf-8" />
<title>Inheriting from UTF-8 parent</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
[
{
"title": "Child with bogus <meta charset>",
"url": "resources/bogus-charset.html",
"expected": "\uFFFD\n" // 0x00A2 in windows-1252 is 0xFFFD in UTF-8
},
{
"title": "Child with bogus Content-Type charset",
"url": "resources/bogus-charset-http.py",
"expected": "\uFFFD\n"
},
{
"title": "Child with bogus Content-Type charset, but valid <meta charset>",
"url": "resources/bogus-charset-http-valid-meta.py",
"expected": "\u045E\n"
}
].forEach(({ title, url, expected }) => {
async_test(t => {
const frame = document.createElement("iframe");
t.add_cleanup(() => frame.remove());
frame.src = url;
frame.onload = t.step_func_done(() => {
assert_equals(frame.contentDocument.body.textContent, expected);
});
document.body.append(frame);
}, title);
});
</script>

View file

@ -0,0 +1,46 @@
<!doctype html>
<meta charset=windows-1253>
<title>Inheriting from windows-1253 parent</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<div id=log></div>
<script>
[
{
"title": "Child with bogus <meta charset>",
"url": "resources/bogus-charset.html",
"expected": "¢\n" // 0x00A2 in windows-1252 is at the same position as 0x0386 in windows-1253
},
{
"title": "Child with bogus Content-Type charset",
"url": "resources/bogus-charset-http.py",
"expected": "¢\n"
},
{
"title": "Child with bogus Content-Type charset, but valid <meta charset>",
"url": "resources/bogus-charset-http-valid-meta.py",
"expected": "\u045E\n"
}
].forEach(({ title, url, expected }) => {
async_test(t => {
const frame = document.createElement("iframe");
t.add_cleanup(() => frame.remove());
frame.src = url;
frame.onload = t.step_func_done(() => {
assert_equals(frame.contentDocument.body.textContent, expected);
});
document.body.append(frame);
}, title);
});
async_test(t => {
self.onmessage = t.step_func_done(({ data }) => {
assert_equals(data, "\u00A2\n");
});
const frame = document.createElement("iframe");
t.add_cleanup(() => frame.remove());
frame.src = get_host_info().HTTP_REMOTE_ORIGIN + new URL("resources/bogus-charset.html", location).pathname + "?postMessage";
document.body.append(frame);
}, "Cross-origin child with bogus <meta charset>");
</script>

View file

@ -0,0 +1,4 @@
def main(request, response):
response.headers.set(b"Content-Type", b"text/html;charset=this-is-not-a-charset")
# ¢
response.content = b"<meta charset=windows-1251>\xA2\n"

View file

@ -0,0 +1,4 @@
def main(request, response):
response.headers.set(b"Content-Type", b"text/html;charset=this-is-not-a-charset")
# ¢
response.content = b"\xA2\n"

View file

@ -0,0 +1,7 @@
<!doctype html><meta charset=this-is-not-a-charset><script>
onload = () => {
if (location.search === "?postMessage") {
parent.postMessage(document.body.textContent, "*");
}
}
</script>¢