mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision ea14651f262003177d0ba5819bd2806a1327b12a
This commit is contained in:
parent
847115ba04
commit
816185f094
272 changed files with 5766 additions and 2855 deletions
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>History pushState sets the url</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
var oldLocation = window.location.toString();
|
||||
window.history.pushState(null, "", "#hash");
|
||||
assert_equals(oldLocation + "#hash", window.location.toString(), "pushState updates url");
|
||||
history.back();
|
||||
window.onhashchange = () => {
|
||||
assert_equals(oldLocation, window.location.toString(), 'history traversal restores old url');
|
||||
t.done();
|
||||
};
|
||||
}, "history pushState sets url");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -25,12 +25,18 @@
|
|||
</div>
|
||||
<script>
|
||||
|
||||
function showOnline() {
|
||||
document.getElementById('actualMsg').innerHTML = 'online event is raised.';
|
||||
function showOnline(e) {
|
||||
let msg = 'online event is raised';
|
||||
if (e.target != window)
|
||||
msg += ' (on the WRONG target)';
|
||||
document.getElementById('actualMsg').innerHTML = msg + '.';
|
||||
}
|
||||
|
||||
function showOffline() {
|
||||
document.getElementById('actualMsg').innerHTML = 'offline event is raised.';
|
||||
function showOffline(e) {
|
||||
let msg = 'offline event is raised';
|
||||
if (e.target != window)
|
||||
msg += ' (on the WRONG target)';
|
||||
document.getElementById('actualMsg').innerHTML = msg + '.';
|
||||
}
|
||||
|
||||
window.addEventListener("online", showOnline, false);
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// In an ideal world this test would eventually be obsolete due to mutation events disappearing. Or
|
||||
// would have to change to account for mutation events not firing synchronously. Neither seems
|
||||
// realistic to the author though.
|
||||
|
||||
test(t => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe"));
|
||||
frame.contentWindow.addEventListener("DOMNodeInserted", t.unreached_func());
|
||||
frame.contentWindow.addEventListener("DOMNodeInserted", t.unreached_func(), true);
|
||||
frame.contentWindow.addEventListener("DOMNodeInsertedIntoDocument", t.unreached_func(), true);
|
||||
frame.contentWindow.addEventListener("DOMNodeRemoved", t.unreached_func());
|
||||
frame.contentWindow.addEventListener("DOMNodeRemoved", t.unreached_func(), true);
|
||||
frame.contentWindow.addEventListener("DOMNodeRemovedFromDocument", t.unreached_func(), true);
|
||||
frame.contentWindow.addEventListener("DOMSubtreeModified", t.unreached_func());
|
||||
frame.contentWindow.addEventListener("DOMSubtreeModified", t.unreached_func(), true);
|
||||
assert_equals(frame.contentDocument.documentElement.localName, "html");
|
||||
frame.contentDocument.open();
|
||||
assert_equals(frame.contentDocument.documentElement, null);
|
||||
frame.contentDocument.write("<div>heya</div>");
|
||||
frame.contentDocument.close();
|
||||
assert_equals(frame.contentDocument.documentElement.localName, "html");
|
||||
frame.remove();
|
||||
}, "document.open(), the HTML parser, and mutation events");
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-the-form-data-set">
|
||||
<link ref="help" href="https://xhr.spec.whatwg.org/#dom-formdata">
|
||||
<link rel="help" href="https://fetch.spec.whatwg.org/#concept-bodyinit-extract">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iframe name="frame1"></iframe>
|
||||
<form accept-charset="iso-8859-1" target="frame1" action="/common/blank.html">
|
||||
<input type="hidden" name="_charset_">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
test(() => {
|
||||
let formData = new FormData(document.querySelector('form'));
|
||||
assert_equals(formData.get('_charset_'), 'UTF-8');
|
||||
}, 'FormData constructor always produces UTF-8 _charset_ value.');
|
||||
|
||||
let t = async_test('_charset_ control sets the expected encoding name.');
|
||||
t.step(() => {
|
||||
let iframe = document.querySelector('iframe');
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
assert_not_equals(iframe.contentDocument.URL.indexOf('_charset_=windows-1252'), -1);
|
||||
});
|
||||
document.querySelector('form').submit();
|
||||
});
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue