Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/event-composed-path.html

Issue 2343923003: Make event.composedPath() on window behave the same way as that on document (Closed)
Patch Set: rebased Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698