| 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 id="description"></p> | 8 <p id="description"></p> |
| 9 <div id="sandbox"></div> | 9 <div id="sandbox"></div> |
| 10 <pre id="console"></pre> | 10 <pre id="console"></pre> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 createDOM('input', {'id': 'inputD'}), | 54 createDOM('input', {'id': 'inputD'}), |
| 55 createDOM('input', {'id': 'inputE', 'accesskey':
'a'}), | 55 createDOM('input', {'id': 'inputE', 'accesskey':
'a'}), |
| 56 createDOM('div', {'id': 'shadowF', 'tabindex': 0
}, | 56 createDOM('div', {'id': 'shadowF', 'tabindex': 0
}, |
| 57 createShadowRoot( | 57 createShadowRoot( |
| 58 createDOM('input', {'id': 'inputG'
}))))))); | 58 createDOM('input', {'id': 'inputG'
}))))))); |
| 59 | 59 |
| 60 var ids = ['inputB', | 60 var ids = ['inputB', |
| 61 'shadowC/inputD', 'shadowC/inputE', | 61 'shadowC/inputD', 'shadowC/inputE', |
| 62 'shadowC/shadowF/inputG']; | 62 'shadowC/shadowF/inputG']; |
| 63 for (var i = 0; i < ids.length; ++i) { | 63 for (var i = 0; i < ids.length; ++i) { |
| 64 var element = getNodeInTreeOfTrees(ids[i]); | 64 var element = getNodeInComposedTree(ids[i]); |
| 65 element.addEventListener('focus', recordEvent, false); | 65 element.addEventListener('focus', recordEvent, false); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 function test() | 69 function test() |
| 70 { | 70 { |
| 71 prepareDOMTree(document.getElementById('sandbox')); | 71 prepareDOMTree(document.getElementById('sandbox')); |
| 72 | 72 |
| 73 // Please see the discussion of https://bugs.webkit.org/show_bug.cgi?id=6709
6. | 73 // Please see the discussion of https://bugs.webkit.org/show_bug.cgi?id=6709
6. |
| 74 // We don't have a clear idea how accesskey should work in regard to shadow
DOM. | 74 // We don't have a clear idea how accesskey should work in regard to shadow
DOM. |
| 75 // In current implementation, accesskeys defined inside of components are ex
posed to an outer document. | 75 // In current implementation, accesskeys defined inside of components are ex
posed to an outer document. |
| 76 // Every accesskeys are flattened per each document. | 76 // Every accesskeys are flattened per each document. |
| 77 document.getElementById('inputB').focus(); | 77 document.getElementById('inputB').focus(); |
| 78 clearEventRecords(); | 78 clearEventRecords(); |
| 79 pressAccessKey('a'); | 79 pressAccessKey('a'); |
| 80 shouldBe('dispatchedEvent("focus")', '["inputE"]'); | 80 shouldBe('dispatchedEvent("focus")', '["inputE"]'); |
| 81 | 81 |
| 82 getNodeInTreeOfTrees('shadowC/inputD').focus(); | 82 getNodeInComposedTree('shadowC/inputD').focus(); |
| 83 clearEventRecords(); | 83 clearEventRecords(); |
| 84 pressAccessKey('a'); | 84 pressAccessKey('a'); |
| 85 shouldBe('dispatchedEvent("focus")', '["inputE"]'); | 85 shouldBe('dispatchedEvent("focus")', '["inputE"]'); |
| 86 | 86 |
| 87 getNodeInTreeOfTrees('shadowC/shadowF/inputG').focus(); | 87 getNodeInComposedTree('shadowC/shadowF/inputG').focus(); |
| 88 clearEventRecords(); | 88 clearEventRecords(); |
| 89 pressAccessKey('a'); | 89 pressAccessKey('a'); |
| 90 shouldBe('dispatchedEvent("focus")', '["inputE"]'); | 90 shouldBe('dispatchedEvent("focus")', '["inputE"]'); |
| 91 } | 91 } |
| 92 | 92 |
| 93 test(); | 93 test(); |
| 94 </script> | 94 </script> |
| 95 </body> | 95 </body> |
| 96 </html> | 96 </html> |
| OLD | NEW |