tor-browser

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

window-composed-path.html (540B)


      1 <!DOCTYPE html>
      2 <title>Window: Event.composedPath()</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <body>
      6 <script>
      7 test(() => {
      8  const target = window;
      9  const event = new Event("foo");
     10 
     11  function listener(e) {
     12    assert_array_equals(e.composedPath(), [target]);
     13  }
     14  target.addEventListener("foo", listener);
     15  target.dispatchEvent(event);
     16  assert_array_equals(event.composedPath(), []);
     17 }, "window target has an empty path after dispatch");
     18 </script>
     19 </body>
     20 </html>