| 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="../fast/dom/shadow/resources/shadow-dom.js"></script> | 5 <script src="../fast/dom/shadow/resources/shadow-dom.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p>This tests TAB focus navigation with delegatesFocus flag on shadow hosts</p> | 8 <p>This tests TAB focus navigation with delegatesFocus flag on shadow hosts</p> |
| 9 <pre id="console"></pre> | 9 <pre id="console"></pre> |
| 10 <div id="sandbox"></div> | 10 <div id="sandbox"></div> |
| 11 <script> | 11 <script> |
| 12 function prepareDOMTree(parent, mode, tabindex, delegatesFocus) { | 12 function prepareDOMTree(parent, mode, tabindex, delegatesFocus) { |
| 13 parent.innerHTML = ''; | 13 parent.innerHTML = ''; |
| 14 parent.appendChild( | 14 parent.appendChild( |
| 15 createDOM('div', {'id': 'testform'}, | 15 createDOM('div', {'id': 'testform'}, |
| 16 createDOM('input', {'id': 'input-before'}), | 16 createDOM('input', {'id': 'input-before'}), |
| 17 createDOM('div', {'id': 'host-div'}, | 17 createDOM('div', {'id': 'host-div'}, |
| 18 createShadowRoot( | 18 createShadowRoot( |
| 19 {'mode': mode, | 19 {'mode': mode, |
| 20 'delegatesFocus': delegatesFocus}, | 20 'delegatesFocus': delegatesFocus}, |
| 21 createDOM('input', {'id': 'inner-input'}))), | 21 createDOM('input', {'id': 'inner-input'}))), |
| 22 createDOM('input', {'id': 'input-after'}))); | 22 createDOM('input', {'id': 'input-after'}))); |
| 23 | 23 |
| 24 if (tabindex !== null) | 24 if (tabindex !== null) |
| 25 parent.querySelector('#host-div').tabIndex = tabindex; | 25 parent.querySelector('#host-div').tabIndex = tabindex; |
| 26 | 26 |
| 27 parent.offsetTop; | |
| 28 } | 27 } |
| 29 | 28 |
| 30 var hostDiv; | 29 var hostDiv; |
| 31 var sandbox = document.getElementById('sandbox'); | 30 var sandbox = document.getElementById('sandbox'); |
| 32 | 31 |
| 33 function test1(mode) { | 32 function test1(mode) { |
| 34 debug('(1/8) Testing tab navigation order without tabindex and delegatesFocu
s=false'); | 33 debug('(1/8) Testing tab navigation order without tabindex and delegatesFocu
s=false'); |
| 35 prepareDOMTree(sandbox, mode, null, false); | 34 prepareDOMTree(sandbox, mode, null, false); |
| 36 hostDiv = document.getElementById('host-div'); | 35 hostDiv = document.getElementById('host-div'); |
| 37 shouldBe('window.internals.shadowRoot(hostDiv).delegatesFocus', 'false'); | 36 shouldBe('window.internals.shadowRoot(hostDiv).delegatesFocus', 'false'); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 206 |
| 208 test(); | 207 test(); |
| 209 | 208 |
| 210 debug('Test finished.'); | 209 debug('Test finished.'); |
| 211 } | 210 } |
| 212 | 211 |
| 213 run_tests(); | 212 run_tests(); |
| 214 </script> | 213 </script> |
| 215 </body> | 214 </body> |
| 216 </html> | 215 </html> |
| OLD | NEW |