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=host> | 5 <div id=host> |
6 <template id=shadowRoot data-mode=open> | 6 <template id=shadowRoot data-mode=open> |
7 <input id=input1></input> | 7 <input id=input1></input> |
8 <input id=input2></input> | 8 <input id=input2></input> |
9 </template> | 9 </template> |
10 </div> | 10 </div> |
11 <script> | 11 <script> |
12 test(() => { | 12 test(() => { |
13 let nodes = createTestTree(host); | 13 let nodes = createTestTree(host); |
14 let log = dispatchEventWithLog(nodes, nodes['input1'], | 14 let log = dispatchEventWithLog(nodes, nodes['input1'], |
15 new FocusEvent('test', { bubbles: true, related
Target: nodes['input2']})); | 15 new FocusEvent('test', { bubbles: true, related
Target: nodes['input2']})); |
16 let expectedPath = ['input1', 'shadowRoot']; | 16 let expectedPath = ['input1', 'shadowRoot']; |
17 assert_event_path_equals(log, | 17 assert_event_path_equals(log, |
18 [['input1', 'input2', expectedPath], | 18 [['input1', 'input1', 'input2', expectedPath], |
19 ['shadowRoot', 'input2', expectedPath]]); | 19 ['shadowRoot', 'input1', 'input2', expectedPath]]); |
20 }, 'An event should stop at the common ancestor of target and relatedTarget.'); | 20 }, 'An event should stop at the common ancestor of target and relatedTarget.'); |
21 </script> | 21 </script> |
OLD | NEW |