tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

form-submit-and-window-stop.html (756B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>The planned navigation of a form should be cancelled by a window stop
      4  in the same task as the form submission</title>
      5 <link rel="help" href="https://github.com/whatwg/html/issues/3730">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="resources/helpers.js"></script>
      9 
     10 <body>
     11 <script>
     12 "use strict";
     13 async_test(t => {
     14  let unloaded = false;
     15  window.onload = t.step_func(() => {
     16    form.submit();
     17    window.stop();
     18  });
     19  window.onunload = () => {
     20    unloaded = true;
     21  };
     22  t.step_timeout(() => {
     23    // The document should not have unloaded.
     24    assert_equals(unloaded, false);
     25    t.done();
     26  }, 100);
     27 });
     28 </script>
     29 <form id="form">