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 <div id="test1"> | 5 <div id="test1"> |
6 <input id="input" slot="slot"> | 6 <input id="input" slot="slot"> |
7 <template id="shadowroot-v1" data-mode="open"> | 7 <template id="shadowroot-v1" data-mode="open"> |
8 <div id="host"> | 8 <div id="host"> |
9 <div id="slot-parent"> | 9 <div id="slot-parent"> |
10 <slot id="slot" name="slot"></slot> | 10 <slot id="slot" name="slot"></slot> |
11 </div> | 11 </div> |
12 <template id="shadowroot-v0" data-mode="v0"> | 12 <template id="shadowroot-v0" data-mode="v0"> |
13 <content id="content" select="#slot-parent"></content> | 13 <content id="content" select="#slot-parent"></content> |
14 </template> | 14 </template> |
15 </div> | 15 </div> |
16 </template> | 16 </template> |
17 </div> | 17 </div> |
18 <script> | 18 <script> |
19 test(() => { | 19 test(() => { |
20 let n = createTestTree(test1); | 20 let n = createTestTree(test1); |
21 removeWhiteSpaceOnlyTextNodes(n.test1); | 21 removeWhiteSpaceOnlyTextNodes(n.test1); |
22 let log = dispatchEventWithLog(n, n.input, new Event('my-event', { bubbles: tr
ue, compsoed: true })); | 22 let log = dispatchEventWithLog(n, n.input, new Event('my-event', { bubbles: tr
ue, compsoed: true })); |
| 23 let path = ['input', 'slot', 'slot-parent', 'content', 'shadowroot-v0', 'host'
, |
| 24 'shadowroot-v1', 'test1']; |
23 assert_event_path_equals(log, | 25 assert_event_path_equals(log, |
24 makeExpectedEventPathLog( | 26 [['input', 'input', null, path], |
25 ['input', 'slot', 'slot-parent', 'content', 'shadow
root-v0', 'host', | 27 ['slot', 'input', null, path], |
26 'shadowroot-v1', 'test1'])); | 28 ['slot-parent', 'input', null, path], |
| 29 ['content', 'input', null, path], |
| 30 ['shadowroot-v0', 'input', null, path], |
| 31 ['host', 'input', null, path], |
| 32 ['shadowroot-v1', 'input', null, path], |
| 33 ['test1', 'input', null, path]]); |
27 }, 'EventPath works fine with v0 insertion points & v1 slots.'); | 34 }, 'EventPath works fine with v0 insertion points & v1 slots.'); |
28 </script> | 35 </script> |
OLD | NEW |