| <!DOCTYPE html> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="resources/shadow-dom.js"></script> |
| <div id=host> |
| <template id=shadowRoot data-mode=open> |
| <input id=input1></input> |
| <input id=input2></input> |
| </template> |
| </div> |
| <script> |
| test(() => { |
| let nodes = createTestTree(host); |
| let log = dispatchEventWithLog(nodes, nodes['input1'], |
| new FocusEvent('test', { bubbles: true, relatedTarget: nodes['input2']})); |
| let expectedPath = ['input1', 'shadowRoot']; |
| assert_event_path_equals(log, |
| [['input1', 'input1', 'input2', expectedPath], |
| ['shadowRoot', 'input1', 'input2', expectedPath]]); |
| }, 'An event should stop at the common ancestor of target and relatedTarget.'); |
| </script> |