| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script src="resources/shadow-dom.js"></script> | 5 <script src="resources/shadow-dom.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p>This tests navigation from non keyboard-focusable shadow host to its shadow.
crbug.com/446584</p> | 8 <p>This tests navigation from non keyboard-focusable shadow host to its shadow.
crbug.com/446584</p> |
| 9 <pre id="console"></pre> | 9 <pre id="console"></pre> |
| 10 <script> | 10 <script> |
| 11 | 11 |
| 12 function prepareDOMTree(parent) | 12 function prepareDOMTree(parent) |
| 13 { | 13 { |
| 14 parent.appendChild( | 14 parent.appendChild( |
| 15 createDOM('input', {'id': 'input-in-document-before'})); | 15 createDOM('input', {'id': 'input-in-document-before'})); |
| 16 parent.appendChild( | 16 parent.appendChild( |
| 17 createDOM('div', {'id': 'host-div', 'tabindex': '-1'}, | 17 createDOM('div', {'id': 'host-div', 'tabindex': '-1'}, |
| 18 createShadowRoot( | 18 createShadowRoot( |
| 19 createDOM('input', {'id': 'input-in-shadow'})))); | 19 createDOM('input', {'id': 'input-in-shadow'})))); |
| 20 parent.appendChild( | 20 parent.appendChild( |
| 21 createDOM('input', {'id': 'input-in-document-after'})); | 21 createDOM('input', {'id': 'input-in-document-after'})); |
| 22 parent.offsetTop; | 22 parent.offsetTop; |
| 23 } | 23 } |
| 24 | 24 |
| 25 function test() { | 25 function test() { |
| 26 if (window.testRunner) | |
| 27 testRunner.dumpAsText(); | |
| 28 | |
| 29 if (!window.eventSender) { | 26 if (!window.eventSender) { |
| 30 testFailed(''); | 27 testFailed(''); |
| 31 return; | 28 return; |
| 32 } | 29 } |
| 33 | 30 |
| 34 prepareDOMTree(document.body); | 31 prepareDOMTree(document.body); |
| 35 | 32 |
| 36 shouldNavigateFocus('host-div', 'host-div/input-in-shadow', 'forward'); | 33 shouldNavigateFocus('host-div', 'host-div/input-in-shadow', 'forward'); |
| 37 shouldNavigateFocus('host-div', 'input-in-document-before', 'backward'); | 34 shouldNavigateFocus('host-div', 'input-in-document-before', 'backward'); |
| 38 | 35 |
| 39 debug('Test finished.'); | 36 debug('Test finished.'); |
| 40 } | 37 } |
| 41 | 38 |
| 42 test(); | 39 test(); |
| 43 </script> | 40 </script> |
| 44 </body> | 41 </body> |
| 45 </html> | 42 </html> |
| OLD | NEW |