navigation-unload-form-submit.html (1004B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#navigating-across-documents"> 6 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> 7 8 <iframe id="i" src="navigation-unload-form-submit-1.html"></iframe> 9 10 <!-- derived from https://bugzilla.mozilla.org/show_bug.cgi?id=247660#c0 --> 11 12 <script> 13 var test = async_test('Tests that navigation during an unload caused by a form submit does nothing'); 14 window.onload = test.step_func(function() { 15 var i = document.querySelector('#i'); 16 17 window.finishedLoading = test.step_func_done(function () { 18 assert_equals(i.contentWindow.location.pathname.split('/').pop(), 'navigation-unload-form-submit-2.html'); 19 assert_equals(i.contentWindow.location.hash, ''); 20 }); 21 22 i.contentWindow.document.querySelector('input[type="submit"]').click(); 23 }); 24 </script>