tor-browser

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

event-dispatch-order.tentative.html (1502B)


      1 <!DOCTYPE html>
      2 <title>Shadow DOM: event dispatch order for capture and non-capture listerns at a shadow host</title>
      3 <meta name="author" title="Hayato Ito" href="mailto:hayato@google.com">
      4 <link rel="help" href="https://github.com/whatwg/dom/issues/685">
      5 <link rel="help" href="https://github.com/whatwg/dom/pull/686">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="resources/shadow-dom.js"></script>
      9 <div id=host>
     10  <template id=shadowroot data-mode=open>
     11    <div id=target></div>
     12  </template>
     13 </div>
     14 <script>
     15 test(() => {
     16  let nodes = createTestTree(host);
     17  let log = dispatchEventWithLog(nodes, nodes.target,
     18                                 new Event('my-event', { bubbles: true, composed: true }),
     19                                 { capture: true });
     20  let path = ['target', 'shadowroot', 'host'];
     21  assert_event_path_equals(log,
     22                           [['host', 'host', null, path, 'capture'],
     23                            ['shadowroot', 'target', null, path, 'capture'],
     24                            ['target', 'target', null, path, 'capture'],
     25                            ['target', 'target', null, path, 'non-capture'],
     26                            ['shadowroot', 'target', null, path, 'non-capture'],
     27                            ['host', 'host', null, path, 'non-capture'],
     28                           ]);
     29 }, 'Event dispatch order: capture listerns should be called in capturing phase at a shadow host');
     30 </script>