| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script src="resources/shadow-dom.js"></script> | 4 <script src="resources/shadow-dom.js"></script> |
| 5 | 5 |
| 6 <div id="test1"> | 6 <div id="test1"> |
| 7 <div id="d1"> | 7 <div id="d1"> |
| 8 <div id="target"></div> | 8 <div id="target"></div> |
| 9 </div> | 9 </div> |
| 10 </div> | 10 </div> |
| 11 | 11 |
| 12 <script> | 12 <script> |
| 13 test(() => { | 13 test(() => { |
| 14 window.addEventListener('my-event', (e) => { |
| 15 assert_array_equals(e.composedPath(), [document.body, document.documentEleme
nt, document, window]); |
| 16 }); |
| 17 document.body.dispatchEvent(new Event('my-event', { bubbles: true, composed: t
rue })); |
| 18 }, 'event.composedPath() on window.'); |
| 19 </script> |
| 20 |
| 21 <script> |
| 22 test(() => { |
| 14 let n = createTestTree(test1); | 23 let n = createTestTree(test1); |
| 15 let log = dispatchEventWithLog(n, n.target, new Event('my-event', { bubbles: t
rue, composed: true })); | 24 let log = dispatchEventWithLog(n, n.target, new Event('my-event', { bubbles: t
rue, composed: true })); |
| 16 let path = ['target', 'd1', 'test1']; | 25 let path = ['target', 'd1', 'test1']; |
| 17 assert_event_path_equals(log, | 26 assert_event_path_equals(log, |
| 18 [['target', 'target', null, path], | 27 [['target', 'target', null, path], |
| 19 ['d1', 'target', null, path], | 28 ['d1', 'target', null, path], |
| 20 ['test1', 'target', null, path]]); | 29 ['test1', 'target', null, path]]); |
| 21 }, 'Event Path without ShadowRoots.'); | 30 }, 'Event Path without ShadowRoots.'); |
| 22 </script> | 31 </script> |
| 23 | 32 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 assert_event_path_equals(log, [['target', 'target', null, path2], | 279 assert_event_path_equals(log, [['target', 'target', null, path2], |
| 271 ['slot1', 'target', null, path1], | 280 ['slot1', 'target', null, path1], |
| 272 ['slot2', 'target', null, path], | 281 ['slot2', 'target', null, path], |
| 273 ['sr2', 'target', null, path], | 282 ['sr2', 'target', null, path], |
| 274 ['host2', 'target', null, path1], | 283 ['host2', 'target', null, path1], |
| 275 ['sr1', 'target', null, path1], | 284 ['sr1', 'target', null, path1], |
| 276 ['host1', 'target', null, path2], | 285 ['host1', 'target', null, path2], |
| 277 ['test11', 'target', null, path2]]); | 286 ['test11', 'target', null, path2]]); |
| 278 }, 'Event Path with slots in nested ShadowRoots: closed > closed.'); | 287 }, 'Event Path with slots in nested ShadowRoots: closed > closed.'); |
| 279 </script> | 288 </script> |
| OLD | NEW |