summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html
blob: 2a9cab4aa4dc0df74ce7baaac64258d2cad688a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE HTML>
<script>
 t = opener.t;
 do_test = t.step_func(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>