mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
t = opener.t;
|
||||
do_test = t.step(function () {
|
||||
localStorage.test6564729 += '4';
|
||||
var d = document;
|
||||
var e = document.open(); // has no effect (ignore-opens-during-unload > 0)
|
||||
localStorage.test6564729 += (e == d) ? '5' : 'A [' + e + '] ';
|
||||
document.write('FAIL - document.write executed and blocked navigation!'); // has no effect (ignore-opens-during-unload > 0)
|
||||
localStorage.test6564729 += document.body.textContent.match('FAIL') ? 'B' : '6';
|
||||
document.close(); // has no effect (no script-created parser)
|
||||
localStorage.test6564729 += '7';
|
||||
})
|
||||
onload = t.step_func(function() {
|
||||
localStorage.test6564729 = '0';
|
||||
setTimeout(t.step_func(function() {document.links[0].click()}));
|
||||
});
|
||||
</script>
|
||||
<body onbeforeunload="localStorage.test6564729 += '1'"
|
||||
onpagehide="localStorage.test6564729 += '3'"
|
||||
onunload="do_test()">
|
||||
<p><a href="001a.html">Follow this link to run the test.</a>
|
||||
<p><iframe src="001b.html"></iframe>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>document.open in unload</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var win;
|
||||
|
||||
t.step(function() {
|
||||
win = window.open("001-1.html");
|
||||
});
|
||||
|
||||
add_completion_callback(function() {win.close()});
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
opener.t.step(function() {
|
||||
opener.assert_equals(localStorage.test6564729, '0123456789');
|
||||
opener.t.done();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE HTML>
|
||||
<body onbeforeunload="localStorage.test6564729 += '2'"
|
||||
onpagehide="localStorage.test6564729 += '8'"
|
||||
onunload="localStorage.test6564729 += '9'">
|
||||
<p>Inner frame
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
var t = opener.t;
|
||||
|
||||
var do_test = t.step_func(function() {
|
||||
localStorage.test6564729 += '1';
|
||||
var d = document;
|
||||
var e = document.open(); // unload triggered here - beforeunload 2, 3 in 002b; pagehide 4, unload 5, pagehide 6 in 002b, unload 7 in 002b
|
||||
localStorage.test6564729 += (e == d) ? '8' : 'X';
|
||||
var s = 'FAIL if you see this | ' + localStorage.test6564729;
|
||||
document.write(s);
|
||||
localStorage.test6564729 += document.body.textContent == s ? '9' : 'x';
|
||||
document.close();
|
||||
localStorage.test6564729 += 'Z';
|
||||
document.body.textContent += ' // ' + localStorage.test6564729;
|
||||
location = '002a.html'; // unload triggers again here, but they're not registered event listeners any more
|
||||
});
|
||||
|
||||
onload = t.step_func(function() {
|
||||
localStorage.test6564729 = '0';
|
||||
setTimeout(function() {document.getElementsByTagName("input")[0].click()}, 100);
|
||||
});
|
||||
</script>
|
||||
<body onbeforeunload="localStorage.test6564729 += '2'"
|
||||
onpagehide="localStorage.test6564729 += '4'"
|
||||
onunload="localStorage.test6564729 += '5'">
|
||||
<input type=button value="Activate this button to run the test" onclick="do_test()">
|
||||
<p><iframe src="002b.html"></iframe>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>document.open in unload</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var win;
|
||||
|
||||
t.step(function() {
|
||||
win = window.open("002-1.html");
|
||||
});
|
||||
|
||||
add_completion_callback(function() {win.close()});
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
opener.t.step(function() {
|
||||
opener.assert_equals(localStorage.test6564729, '0123456789Z');
|
||||
opener.t.done();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE HTML>
|
||||
<body onbeforeunload="localStorage.test6564729 += '3'"
|
||||
onpagehide="localStorage.test6564729 += '6'"
|
||||
onunload="localStorage.test6564729 += '7'">
|
||||
<p>Inner frame
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
var t = opener.t;
|
||||
var do_test = t.step_func(function() {
|
||||
localStorage.test6564729 += '1';
|
||||
var d = document;
|
||||
var e = document.open(); // has no effect (ignore-opens-during-unload > 0 because we're in beforeunload)
|
||||
localStorage.test6564729 += (e == d) ? '2' : 'A [' + e + '] ';
|
||||
document.write('FAIL - document.write executed and blocked navigation!'); // has no effect (ignore-opens-during-unload > 0)
|
||||
localStorage.test6564729 += document.body.textContent.match('FAIL') ? 'B' : '3';
|
||||
document.close(); // has no effect (no script-created parser)
|
||||
localStorage.test6564729 += '4';
|
||||
})
|
||||
|
||||
onload=t.step_func(function() {localStorage.test6564729 = '0'; setTimeout(t.step_func(function() {document.links[0].click()}), 100)})
|
||||
|
||||
</script>
|
||||
<body
|
||||
onbeforeunload="do_test()"
|
||||
onpagehide="localStorage.test6564729 += '6'"
|
||||
onunload="localStorage.test6564729 += '7'">
|
||||
<p><a href="003a.html">Follow this link to run the test.</a>
|
||||
<p><iframe src="003b.html"></iframe>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>document.open in beforeunload with link</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var win;
|
||||
|
||||
t.step(function() {
|
||||
win = window.open("003-1.html");
|
||||
});
|
||||
|
||||
add_completion_callback(function() {win.close()});
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE HTML>
|
||||
<p>FAIL</p>
|
||||
<script>
|
||||
opener.t.step(function() {
|
||||
opener.assert_equals(localStorage.test6564729, '0123456789')
|
||||
opener.t.done();
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE HTML>
|
||||
<body onbeforeunload="localStorage.test6564729 += '5'"
|
||||
onpagehide="localStorage.test6564729 += '8'"
|
||||
onunload="localStorage.test6564729 += '9'">
|
||||
<p>Inner frame
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
var t = opener.t;
|
||||
var do_test = t.step_func(function() {
|
||||
localStorage.test6564729 += 'B';
|
||||
var d = document;
|
||||
var e = document.open(); // unload triggered here - beforeunload C, D in 004b; pagehide E, unload F, pagehide G in 004b, unload HIJK in 004b
|
||||
localStorage.test6564729 += (e == d) ? 'L' : 'Y';
|
||||
var s = 'FAIL if you see this | ' + localStorage.test6564729;
|
||||
document.write(s);
|
||||
localStorage.test6564729 += document.body.textContent == s ? 'M' : 'y';
|
||||
document.close();
|
||||
localStorage.test6564729 += 'N';
|
||||
location = '004a.html'; // unload triggers again here, but they're not registered event listeners any more
|
||||
})
|
||||
onload = t.step_func(function() {
|
||||
localStorage.test6564729 = 'A';
|
||||
setTimeout(t.step_func(function() {document.getElementsByTagName("input")[0].click()}), 100);
|
||||
})
|
||||
</script>
|
||||
<body onbeforeunload="localStorage.test6564729 += 'C'"
|
||||
onpagehide="localStorage.test6564729 += 'E'"
|
||||
onunload="localStorage.test6564729 += 'F'">
|
||||
<input type=button value="Activate this button to run the test" onclick="do_test()">
|
||||
<p><iframe src="004b.html"></iframe>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>document.open in beforeunload with button</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var win;
|
||||
|
||||
t.step(function() {
|
||||
win = window.open("004-1.html");
|
||||
});
|
||||
|
||||
add_completion_callback(function() {win.close()});
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE HTML>
|
||||
<p>FAIL</p>
|
||||
<script>
|
||||
opener.t.step(function() {
|
||||
opener.assert_equals(localStorage.test6564729, 'ABCDEFGHIJKLMN');
|
||||
opener.t.done();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
function testRun() {
|
||||
localStorage.test6564729 += 'H';
|
||||
var d = parent.document;
|
||||
var e = parent.document.open(); // no effect, since that document is already in unload
|
||||
localStorage.test6564729 += (e == d) ? 'I' : 'X';
|
||||
var s = 'FAIL';
|
||||
document.write(s);
|
||||
localStorage.test6564729 += document.body.textContent == s ? 'x' : 'J';
|
||||
document.close();
|
||||
localStorage.test6564729 += 'K';
|
||||
}
|
||||
</script>
|
||||
<body onbeforeunload="localStorage.test6564729 += 'D'"
|
||||
onpagehide="localStorage.test6564729 += 'G'"
|
||||
onunload="testRun()">
|
||||
<p>Inner frame
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
onload = opener.t.step_func(function() {
|
||||
localStorage.test6564729 = '0'
|
||||
setTimeout(opener.t.step_func(function() {document.links[0].click()}), 100);
|
||||
});
|
||||
</script>
|
||||
<body
|
||||
onbeforeunload="localStorage.test6564729 += '1'"
|
||||
onpagehide="localStorage.test6564729 += '3'"
|
||||
onunload="localStorage.test6564729 += '4'">
|
||||
<p><a href="005a.html">Follow this link to run the test.</a>
|
||||
<p><iframe src="005b.html"></iframe>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>document.open in pagehide in iframe</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var win;
|
||||
|
||||
t.step(function() {
|
||||
win = window.open("005-1.html");
|
||||
});
|
||||
|
||||
add_completion_callback(function() {win.close()});
|
||||
</script>
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE HTML>
|
||||
<p>FAIL</p>
|
||||
<script>
|
||||
opener.t.step(function() {
|
||||
opener.assert_equals(localStorage.test6564729, '012345678')
|
||||
opener.t.done();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<script>
|
||||
var t = parent.opener.t;
|
||||
var do_test = t.step_func(function () {
|
||||
localStorage.test6564729 += '5';
|
||||
var s = 'FAIL: document.open() has canceled the navigation (' + localStorage.test6564729 + ')';
|
||||
parent.document.open();
|
||||
parent.document.write(s);
|
||||
parent.document.close();
|
||||
localStorage.test6564729 += parent.document.body.textContent.match('FAIL') == s ? 'X' : '6';
|
||||
localStorage.test6564729 += '7';
|
||||
});
|
||||
</script>
|
||||
<body onbeforeunload="localStorage.test6564729 += '2'"
|
||||
onpagehide="do_test()"
|
||||
onunload="localStorage.test6564729 += '8'">
|
||||
<p>Inner frame
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"id": "event-definition",
|
||||
"original_id": "event-definition"
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue