Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function pass() | 6 function print(result) |
|
dmazzoni
2013/08/01 21:48:15
I liked it better with pass() and fail().
rchl
2013/08/20 17:58:10
Done.
| |
| 7 { | 7 { |
| 8 var el = document.querySelector('pre'); | 8 var el = document.querySelector('pre'); |
| 9 el.textContent = 'PASS'; | 9 el.textContent += result + '\n'; |
| 10 } | |
| 11 | |
| 12 function fail() | |
| 13 { | |
| 14 var el = document.querySelector('pre'); | |
| 15 el.textContent = 'FAIL'; | |
| 16 } | 10 } |
| 17 | 11 |
| 18 if (window.testRunner) { | 12 if (window.testRunner) { |
| 19 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
| 20 testRunner.overridePreference('WebKitTabToLinksPreferenceKey', false); | 14 testRunner.overridePreference('WebKitTabToLinksPreferenceKey', false); |
| 21 } | 15 } |
| 22 | 16 |
| 23 window.onload = function() | 17 window.onload = function() |
| 24 { | 18 { |
| 25 if (!window.testRunner) | 19 if (!window.testRunner) |
| 26 return; | 20 return; |
| 27 | 21 |
| 28 for (var i = 0; i < 1; i++) { | 22 for (var i = 0; i < 2; i++) { |
| 29 eventSender.keyDown('\t'); | 23 eventSender.keyDown('\t'); |
| 30 } | 24 } |
| 31 }; | 25 }; |
| 32 | 26 |
| 33 </script> | 27 </script> |
| 34 </head> | 28 </head> |
| 35 <body> | 29 <body> |
| 36 | 30 |
| 37 <p>This test ensures that we can tab to an a element with a tab index. Press tab | 31 <p>This test ensures that we can tab to an a element with a tab index. Press tab |
| 38 to focus the element below. | 32 to focus the element below. |
| 39 | 33 |
| 40 <p><a tabindex=0 onfocus="fail()" href="#">Not focusable (given the WebKitTabToL inks pref is set to false)</a> | 34 <p><a onfocus="print('FAIL')" href="#">Not focusable (given the WebKitTabToLinks pref is set to false)</a> |
| 41 <p><a tabindex=0 onfocus="pass()">Focusable</a> | 35 <p><a onfocus="print('FAIL')">Not focusable (given the WebKitTabToLinks pref is set to false)</a> |
|
dmazzoni
2013/08/01 21:48:15
This one is not focusable no matter what the value
rchl
2013/08/20 17:58:10
Done.
| |
| 36 <p><a tabindex=0 onfocus="print('PASS')" href="#">Focusable</a> | |
| 37 <p><a tabindex=0 onfocus="print('PASS')">Focusable</a> | |
| 42 | 38 |
| 43 <p>Result | 39 <p>Result |
| 44 | 40 |
| 45 <pre>FAIL</pre> | 41 <pre id="out"></pre> |
| 46 | 42 |
| 47 </body> | 43 </body> |
| 48 </html> | 44 </html> |
| OLD | NEW |