mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update web-platform-tests to revision 36634cbcf3253dfe8d220990a27ad4eeebf8ec2f
This commit is contained in:
parent
0964d055cd
commit
7295abcc2a
245 changed files with 5966 additions and 1901 deletions
|
@ -4,6 +4,7 @@
|
|||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
|
||||
<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>
|
||||
<div id="test">
|
||||
<script>
|
||||
|
@ -31,18 +32,6 @@ tUnsupported.step(function() {
|
|||
elt.rel = "stylesheet";
|
||||
elt.href = "nonexistent:stylesheet.css";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
|
||||
var tText = async_test("Should get an error event for a text/plain response.")
|
||||
tText.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = tText.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
tText.done()
|
||||
})
|
||||
elt.onload = tText.unreached_func("load event should not be fired");
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "../../../../../common/css-red.txt";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<script src=resources/link-style-error.js></script>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//" "">
|
||||
<title>link: error events in limited quirks mode</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 src=resources/link-style-error.js></script>
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//Sun Microsystems Corp.//DTD HotJava Strict HTML//" "">
|
||||
<title>link: error events in quirks mode</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 src=resources/link-style-error.js></script>
|
|
@ -0,0 +1,7 @@
|
|||
def main(request, response):
|
||||
response.add_required_headers = False
|
||||
if "content_type" in request.GET:
|
||||
response.writer.write_header("Content-Type", request.GET.first("content_type"))
|
||||
if "nosniff" in request.GET:
|
||||
response.writer.write_header("x-content-type-options", "nosniff")
|
||||
response.writer.write_content("body { background:red }")
|
|
@ -0,0 +1,47 @@
|
|||
["<link>", "@import"].forEach(linkType => {
|
||||
[
|
||||
["same-origin", "resources/css.py"],
|
||||
["cross-origin", get_host_info().HTTP_REMOTE_ORIGIN + "/html/semantics/document-metadata/the-link-element/resources/css.py"]
|
||||
].forEach(originType => {
|
||||
["no Content-Type", "wrong Content-Type", "broken Content-Type"].forEach(contentType => {
|
||||
["no nosniff", "nosniff"].forEach(nosniff => {
|
||||
async_test(t => {
|
||||
const l = document.createElement("link");
|
||||
t.add_cleanup(() => l.remove());
|
||||
if (nosniff === "nosniff" || contentType === "wrong Content-Type" && (document.compatMode === "CSS1Compat" || originType[0] === "cross-origin")) {
|
||||
l.onerror = t.step_func_done();
|
||||
l.onload = t.unreached_func("error event should have fired");
|
||||
} else {
|
||||
l.onload = t.step_func_done();
|
||||
l.onerror = t.unreached_func("load event should have fired");
|
||||
}
|
||||
l.rel = "stylesheet";
|
||||
let query = [];
|
||||
if (contentType === "broken Content-Type") {
|
||||
query.push("content_type=oops");
|
||||
} else if (contentType === "wrong Content-Type") {
|
||||
query.push("content_type=text/plain")
|
||||
}
|
||||
if (nosniff === "nosniff") {
|
||||
query.push("nosniff");
|
||||
}
|
||||
let stringQuery = "";
|
||||
query.forEach(val => {
|
||||
if (stringQuery === "") {
|
||||
stringQuery += "?" + val;
|
||||
} else {
|
||||
stringQuery += "&" + val;
|
||||
}
|
||||
});
|
||||
const link = new URL(originType[1] + stringQuery, location).href;
|
||||
if (linkType === "<link>") {
|
||||
l.href = link;
|
||||
} else {
|
||||
l.href = "data:text/css,@import url(" + link + ");";
|
||||
}
|
||||
document.head.appendChild(l);
|
||||
}, "Stylesheet loading using " + linkType + " with " + contentType + ", " + originType[0] + ", and " + nosniff);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -15,7 +15,7 @@ async_test(function(t) {
|
|||
video.textTracks.onchange = t.step_func_done(function() {
|
||||
assert_equals(event.target, video.textTracks);
|
||||
assert_true(event instanceof Event, 'instanceof');
|
||||
assert_not_exists(event, 'track');
|
||||
assert_false(event.hasOwnProperty('track'), 'unexpected property found: "track"');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>Check processing of iframe without src and srcdoc attribute</title>
|
||||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
|
||||
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
<iframe></iframe>
|
||||
<script>
|
||||
let iframe = document.querySelector("iframe");
|
||||
|
||||
async_test(t => {
|
||||
let originDoc = iframe.contentDocument;
|
||||
window.addEventListener("load", t.step_func_done(() => {
|
||||
assert_equals(iframe.contentDocument, originDoc, "contentDocument shouldn't be changed");
|
||||
}));
|
||||
}, "iframe.contentDocument should not be changed");
|
||||
|
||||
async_test(t => {
|
||||
iframe.addEventListener("load", t.unreached_func());
|
||||
window.addEventListener("load", () => t.done());
|
||||
}, "load event of iframe should not be fired after processing the element");
|
||||
</script>
|
|
@ -42,10 +42,10 @@
|
|||
}, desc);
|
||||
}
|
||||
|
||||
autocompletetest(document.forms.missing_attribute, ["on", "on", "on", "off", ""], "form autocomplete attribute missing");
|
||||
autocompletetest(document.forms.autocomplete_on, ["on", "on", "on", "off", ""], "form autocomplete attribute on");
|
||||
autocompletetest(document.forms.autocomplete_off, ["off", "off", "on", "off", ""], "form autocomplete attribute off");
|
||||
autocompletetest(document.forms.autocomplete_invalid, ["on", "on", "on", "off", ""], "form autocomplete attribute invalid");
|
||||
autocompletetest(document.forms.missing_attribute, ["on", "", "on", "off", ""], "form autocomplete attribute missing");
|
||||
autocompletetest(document.forms.autocomplete_on, ["on", "", "on", "off", ""], "form autocomplete attribute on");
|
||||
autocompletetest(document.forms.autocomplete_off, ["off", "", "on", "off", ""], "form autocomplete attribute off");
|
||||
autocompletetest(document.forms.autocomplete_invalid, ["on", "", "on", "off", ""], "form autocomplete attribute invalid");
|
||||
|
||||
var keywords = [ "on", "off", "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "username", "new-password", "current-password", "organization-title", "organization", "street-address", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "url", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "email", "impp" ];
|
||||
|
||||
|
@ -58,4 +58,59 @@
|
|||
assert_equals(input.autocomplete, keyword);
|
||||
}, keyword + " is an allowed autocomplete field name");
|
||||
});
|
||||
|
||||
|
||||
test(() => {
|
||||
const select = document.createElement("select");
|
||||
select.setAttribute("autocomplete", " \n");
|
||||
assert_equals(select.autocomplete, "");
|
||||
}, "Test whitespace-only attribute value");
|
||||
|
||||
test(() => {
|
||||
const select = document.createElement("select");
|
||||
|
||||
select.setAttribute("autocomplete", "foo off");
|
||||
assert_equals(select.autocomplete, "");
|
||||
|
||||
// Normal category; max=3
|
||||
select.setAttribute("autocomplete", "foo section-foo billing name");
|
||||
assert_equals(select.autocomplete, "");
|
||||
|
||||
// Contact category; max=4
|
||||
select.setAttribute("autocomplete", "foo section-bar billing work name");
|
||||
assert_equals(select.autocomplete, "");
|
||||
}, "Test maximum number of tokens");
|
||||
|
||||
test(() => {
|
||||
const textarea = document.createElement("textarea");
|
||||
|
||||
textarea.setAttribute("autocomplete", "call-sign");
|
||||
assert_equals(textarea.autocomplete, "");
|
||||
}, "Unknown field");
|
||||
|
||||
test(() => {
|
||||
const hidden = document.createElement("input");
|
||||
hidden.type = "hidden";
|
||||
hidden.setAttribute("autocomplete", "on");
|
||||
assert_equals(hidden.autocomplete, "");
|
||||
hidden.setAttribute("autocomplete", "off");
|
||||
assert_equals(hidden.autocomplete, "");
|
||||
}, "Test 'wearing the autofill anchor mantle' with off/on");
|
||||
|
||||
test(() => {
|
||||
const textarea = document.createElement("textarea");
|
||||
|
||||
textarea.setAttribute("autocomplete", " HOME\ntel");
|
||||
assert_equals(textarea.autocomplete, "home tel");
|
||||
|
||||
textarea.setAttribute("autocomplete", "shipping country");
|
||||
assert_equals(textarea.autocomplete, "shipping country");
|
||||
|
||||
textarea.setAttribute("autocomplete", "billing work email");
|
||||
assert_equals(textarea.autocomplete, "billing work email");
|
||||
|
||||
textarea.setAttribute("autocomplete", " section-FOO bday");
|
||||
assert_equals(textarea.autocomplete, "section-foo bday");
|
||||
}, "Serialize combinations of section, mode, contact, and field");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -39,31 +39,31 @@ promise_test(t => {
|
|||
}).then(() => {
|
||||
const w = iframe.contentWindow;
|
||||
|
||||
assert_equals(w.sameOriginNone, 'not found',
|
||||
'Modules should be loaded without the credentials when the crossOrigin attribute is not specified and the target is same-origin');
|
||||
assert_equals(w.sameOriginNone, 'found',
|
||||
'Modules should be loaded with the credentials when the crossOrigin attribute is not specified and the target is same-origin');
|
||||
assert_equals(w.sameOriginAnonymous, 'found',
|
||||
'Modules should be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is same-origin');
|
||||
assert_equals(w.sameOriginUseCredentials, 'found',
|
||||
'Modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is same-origin');
|
||||
assert_equals(w.crossOriginNone, 'not found',
|
||||
'Modules should be loaded without the credentials when the crossOrigin attribute is not specified and the target is cross-origin');
|
||||
'Modules should not be loaded with the credentials when the crossOrigin attribute is not specified and the target is cross-origin');
|
||||
assert_equals(w.crossOriginAnonymous, 'not found',
|
||||
'Modules should be loaded without the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is cross-origin');
|
||||
'Modules should not be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is cross-origin');
|
||||
assert_equals(w.crossOriginUseCredentials, 'found',
|
||||
'Modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is cross-origin');
|
||||
|
||||
assert_equals(w.sameOriginNoneDecendent, 'not found',
|
||||
'Decendent modules should be loaded without the credentials when the crossOrigin attribute is not specified and the target is same-origin');
|
||||
assert_equals(w.sameOriginAnonymousDecendent, 'found',
|
||||
'Decendent modules should be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is same-origin');
|
||||
assert_equals(w.sameOriginUseCredentialsDecendent, 'found',
|
||||
'Decendent modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is same-origin');
|
||||
assert_equals(w.crossOriginNoneDecendent, 'not found',
|
||||
'Decendent modules should be loaded without the credentials when the crossOrigin attribute is not specified and the target is cross-origin');
|
||||
assert_equals(w.crossOriginAnonymousDecendent, 'not found',
|
||||
'Decendent modules should be loaded without the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is cross-origin');
|
||||
assert_equals(w.crossOriginUseCredentialsDecendent, 'found',
|
||||
'Decendent modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is cross-origin');
|
||||
assert_equals(w.sameOriginNoneDescendant, 'found',
|
||||
'Descendant modules should be loaded with the credentials when the crossOrigin attribute is not specified and the target is same-origin');
|
||||
assert_equals(w.sameOriginAnonymousDescendant, 'found',
|
||||
'Descendant modules should be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is same-origin');
|
||||
assert_equals(w.sameOriginUseCredentialsDescendant, 'found',
|
||||
'Descendant modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is same-origin');
|
||||
assert_equals(w.crossOriginNoneDescendant, 'not found',
|
||||
'Descendant modules should not be loaded with the credentials when the crossOrigin attribute is not specified and the target is cross-origin');
|
||||
assert_equals(w.crossOriginAnonymousDescendant, 'not found',
|
||||
'Descendant modules should not be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is cross-origin');
|
||||
assert_equals(w.crossOriginUseCredentialsDescendant, 'found',
|
||||
'Descendant modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is cross-origin');
|
||||
});
|
||||
}, 'Modules should be loaded with or without the credentials based on the same-origin-ness and the crossOrigin attribute');
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
host_info = get_host_info();
|
||||
|
||||
document.cookie = 'same=1';
|
||||
|
||||
const setCookiePromise = fetch(
|
||||
'http://{{domains[www2]}}:{{ports[http][0]}}/cookies/resources/set-cookie.py?name=cross&path=/html/semantics/scripting-1/the-script-element/module/',
|
||||
{
|
||||
mode: 'no-cors',
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
const windowLoadPromise = new Promise(resolve => {
|
||||
window.addEventListener('load', () => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
promise_test(t => {
|
||||
const iframe = document.createElement('iframe');
|
||||
|
||||
return Promise.all([setCookiePromise, windowLoadPromise]).then(() => {
|
||||
const messagePromise = new Promise(resolve => {
|
||||
window.addEventListener('message', event => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
iframe.src = '../resources/dynamic-import-credentials-iframe.sub.html';
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
return messagePromise;
|
||||
}).then(() => {
|
||||
const w = iframe.contentWindow;
|
||||
|
||||
assert_equals(w.sameOriginNoneDynamicDescendant, 'found',
|
||||
'Dynamic descendant modules should be loaded with the credentials when the crossOrigin attribute is not specified and the target is same-origin');
|
||||
assert_equals(w.sameOriginAnonymousDynamicDescendant, 'found',
|
||||
'Dynamic descendant modules should be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is same-origin');
|
||||
assert_equals(w.sameOriginUseCredentialsDynamicDescendant, 'found',
|
||||
'Dynamic descendant modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is same-origin');
|
||||
assert_equals(w.crossOriginNoneDynamicDescendant, 'not found',
|
||||
'Dynamic descendant modules should not be loaded with the credentials when the crossOrigin attribute is not specified and the target is cross-origin');
|
||||
assert_equals(w.crossOriginAnonymousDynamicDescendant, 'not found',
|
||||
'Dynamic descendant modules should not be loaded with the credentials when the crossOrigin attribute is specified with "anonymous" as its value and the target is cross-origin');
|
||||
assert_equals(w.crossOriginUseCredentialsDynamicDescendant, 'found',
|
||||
'Dynamic descendant modules should be loaded with the credentials when the crossOrigin attribute is specified with "use-credentials" as its value and the target is cross-origin');
|
||||
});
|
||||
}, 'Dynamic imports should be loaded with or without the credentials based on the same-origin-ness and the parent script\'s crossOrigin attribute');
|
||||
</script>
|
||||
<body>
|
||||
</body>
|
|
@ -25,22 +25,22 @@
|
|||
</script>
|
||||
|
||||
<script type="module">
|
||||
import "./check-cookie.py?id=sameOriginNoneDecendent&cookieName=same";
|
||||
import "./check-cookie.py?id=sameOriginNoneDescendant&cookieName=same";
|
||||
</script>
|
||||
<script type="module" crossOrigin="anonymous">
|
||||
import "./check-cookie.py?id=sameOriginAnonymousDecendent&cookieName=same";
|
||||
import "./check-cookie.py?id=sameOriginAnonymousDescendant&cookieName=same";
|
||||
</script>
|
||||
<script type="module" crossOrigin="use-credentials">
|
||||
import "./check-cookie.py?id=sameOriginUseCredentialsDecendent&cookieName=same";
|
||||
import "./check-cookie.py?id=sameOriginUseCredentialsDescendant&cookieName=same";
|
||||
</script>
|
||||
<script type="module">
|
||||
import "http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginNoneDecendent&cookieName=cross";
|
||||
import "http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginNoneDescendant&cookieName=cross";
|
||||
</script>
|
||||
<script type="module" crossOrigin="anonymous">
|
||||
import "http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginAnonymousDecendent&cookieName=cross";
|
||||
import "http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginAnonymousDescendant&cookieName=cross";
|
||||
</script>
|
||||
<script type="module" crossOrigin="use-credentials">
|
||||
import "http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginUseCredentialsDecendent&cookieName=cross";
|
||||
import "http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginUseCredentialsDescendant&cookieName=cross";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<script type="module">
|
||||
import("./check-cookie.py?id=sameOriginNoneDynamicDescendant&cookieName=same");
|
||||
</script>
|
||||
<script type="module" crossOrigin="anonymous">
|
||||
import("./check-cookie.py?id=sameOriginAnonymousDynamicDescendant&cookieName=same");
|
||||
</script>
|
||||
<script type="module" crossOrigin="use-credentials">
|
||||
import("./check-cookie.py?id=sameOriginUseCredentialsDynamicDescendant&cookieName=same");
|
||||
</script>
|
||||
<script type="module">
|
||||
import("http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginNoneDynamicDescendant&cookieName=cross");
|
||||
</script>
|
||||
<script type="module" crossOrigin="anonymous">
|
||||
import("http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginAnonymousDynamicDescendant&cookieName=cross");
|
||||
</script>
|
||||
<script type="module" crossOrigin="use-credentials">
|
||||
import("http://{{domains[www2]}}:{{ports[http][0]}}/html/semantics/scripting-1/the-script-element/module/resources/check-cookie.py?id=crossOriginUseCredentialsDynamicDescendant&cookieName=cross");
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('load', event => {
|
||||
window.parent.postMessage({}, '*');
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue