Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / tab-focus-anchor.html
blob2f810dc5de38fd87b40a16a8f8e271316e0e8bdb
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
6 function pass()
8 var el = document.querySelector('pre');
9 el.textContent += 'PASS\n';
12 function fail()
14 var el = document.querySelector('pre');
15 el.textContent += 'FAIL\n';
18 if (window.testRunner) {
19 testRunner.dumpAsText();
20 testRunner.overridePreference('WebKitTabToLinksPreferenceKey', false);
23 window.onload = function()
25 if (!window.testRunner)
26 return;
28 for (var i = 0; i < 2; i++) {
29 eventSender.keyDown('\t');
33 </script>
34 </head>
35 <body>
37 <p>This test ensures that we can tab to an a element with a tab index. Press tab
38 to focus the element below.
40 <p><a onfocus="fail()" href="#">Not focusable (given the WebKitTabToLinks pref is set to false)</a>
41 <p><a onfocus="fail()">Not focusable</a>
42 <p><a tabindex=0 onfocus="pass()" href="#">Focusable</a>
43 <p><a tabindex=0 onfocus="pass()">Focusable</a>
45 <p>Result
47 <pre id="out"></pre>
49 </body>
50 </html>