same-document-traversal-stop.html (1090B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Stop during same-document traversals</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <!-- 8 The spec says that stop() must not stop traverals. 9 10 (Note: the spec also says the UI "stop" button must not stop traversals, but 11 that does not match browsers. See https://github.com/whatwg/html/issues/6905. 12 But that is not what's under test here.) 13 --> 14 15 <body> 16 <script type="module"> 17 import { createIframe, delay } from "./resources/helpers.mjs"; 18 19 promise_test(async t => { 20 const iframe = await createIframe(t); 21 22 // Setup 23 iframe.contentWindow.location.hash = "#1"; 24 await delay(t, 0); 25 iframe.contentWindow.location.hash = "#2"; 26 await delay(t, 0); 27 28 iframe.contentWindow.history.back(); 29 30 assert_equals(iframe.contentWindow.location.hash, "#2", "must not go back synchronously"); 31 32 window.stop(); 33 34 // Does go back eventually 35 await t.step_wait(() => iframe.contentWindow.location.hash === "#1"); 36 }, "same-document traversals are not stopped by stop()"); 37 </script>