mirror of
https://github.com/servo/servo
synced 2026-05-02 20:32:02 +02:00
Update web-platform-tests to revision 7da6acfd668e66adae5ab4e2d389810d3b1460be
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<script>
|
||||
addEventListener("beforeunload",
|
||||
function() {
|
||||
parent.events.push("beforeunload");
|
||||
}, false);
|
||||
parent.events.push("before src change");
|
||||
|
||||
location.href = "001-2.html&pipe=trickle(d2)";
|
||||
parent.events.push("after src change");
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
001-2
|
||||
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<title>beforeunload event order</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
events = [];
|
||||
onload = t.step_func(function() {
|
||||
assert_array_equals(events, ["before src change", "beforeunload", "after src change"]);
|
||||
t.done();
|
||||
})
|
||||
</script>
|
||||
<iframe src="001-1.html"></iframe>
|
||||
@@ -0,0 +1,7 @@
|
||||
<script>
|
||||
addEventListsner("beforeunload", parent.t.step_func(
|
||||
function(e) {
|
||||
parent.do_test(e);
|
||||
}, false);
|
||||
location.href = "001-2.html&pipe=trickle(d2)";
|
||||
</script>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<title>beforeunload event properties</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
|
||||
function do_test(e) {
|
||||
assert_equals(e.type, "beforeunload");
|
||||
assert_false(e.bubbles, "bubbles");
|
||||
assert_true(e.cancelable, "bubbles");
|
||||
assert_equals(e.returnValue, "");
|
||||
}
|
||||
|
||||
onload = t.step_func(function() {
|
||||
t.done();
|
||||
})
|
||||
</script>
|
||||
<iframe src="001-1.html"></iframe>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<title>beforeunload event in child frame for parent navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
|
||||
function do_test(e) {
|
||||
assert_equals(e.type, "beforeunload");
|
||||
assert_false(e.bubbles, "bubbles");
|
||||
assert_true(e.cancelable, "bubbles");
|
||||
assert_equals(e.returnValue, "");
|
||||
}
|
||||
|
||||
onload = t.step_func(function() {
|
||||
t.done();
|
||||
})
|
||||
</script>
|
||||
<iframe src="001-1.html"></iframe>
|
||||
@@ -0,0 +1,14 @@
|
||||
support 001-1.html
|
||||
support 001-2.html
|
||||
001.html
|
||||
support 002-1.html
|
||||
002.html
|
||||
003.html
|
||||
manual manual-001.html
|
||||
manual manual-002.html
|
||||
manual manual-003.html
|
||||
manual manual-004.html
|
||||
manual manual-005.html
|
||||
manual manual-006.html
|
||||
support next.html
|
||||
support slice-and-dice.php
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<title>Prompt when beforeunload is canceled</title>
|
||||
<script>
|
||||
addEventListener("beforeunload",
|
||||
function(e) {e.preventDefault()},
|
||||
false);
|
||||
</script>
|
||||
<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
|
||||
<a href="next.html">Click here</a>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<title>Prompt when beforeunload has returnValue set</title>
|
||||
<script>
|
||||
addEventListener("beforeunload",
|
||||
function(e) {e.returnValue = "PASS if you see this"},
|
||||
false);
|
||||
</script>
|
||||
<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
|
||||
<a href="next.html">Click here</a>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<title>Prompt when beforeunload is canceled</title>
|
||||
<script>
|
||||
addEventListener("beforeunload",
|
||||
function(e) {e.preventDefault()},
|
||||
false);
|
||||
</script>
|
||||
<p>When clicking the button below, you should get a prompt asking if you want to unload the document</p>
|
||||
<form method="get" action="next.html">
|
||||
<input type="submit" value="Click here">
|
||||
</form>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<title>Prompt on form submit</title>
|
||||
<script>
|
||||
addEventListener("beforeunload",
|
||||
function(e) {e.preventDefault()},
|
||||
false);
|
||||
</script>
|
||||
<p>When clicking the button below, you should get a prompt asking if you want to unload the document</p>
|
||||
<form method="get" action="next.html">
|
||||
<input type="submit" value="Click here">
|
||||
</form>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!doctype html>
|
||||
<title>Event loop pause for beforeunload</title>
|
||||
<script>
|
||||
var counter = 0;
|
||||
|
||||
onload = function count() {
|
||||
document.getElementById("log").textContent = counter++
|
||||
setTimeout(count, 200);
|
||||
}
|
||||
|
||||
addEventListener("beforeunload",
|
||||
function(e) {
|
||||
e.preventDefault()
|
||||
},
|
||||
false);
|
||||
</script>
|
||||
<ul>
|
||||
<li>Click on the link below. When the prompt appears the counter at the bottom must stop incrementing.
|
||||
<li>Opt not to leave the page. The counter must start incrementing again
|
||||
</ul>
|
||||
<p><a href="">Click here</a>
|
||||
<div id="log"></div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!doctype html>
|
||||
<title>Prompt when beforeunload returns string value</title>
|
||||
<script>
|
||||
addEventListener("beforeunload",
|
||||
function(e) {return "PASS if you see this"},
|
||||
false);
|
||||
</script>
|
||||
<p>When clicking the link below, you should get a prompt asking if you want to unload the document</p>
|
||||
<a href="next.html">Click here</a>
|
||||
@@ -0,0 +1,2 @@
|
||||
<!doctype html>
|
||||
<p>You should have seen a prompt asking you to unload the previous document
|
||||
Reference in New Issue
Block a user