Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / anchor-empty-focus.html
blobeea6b9433d3b53468a7a46fc2f3787962cc64c19
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body onload="test()">
6 <a id="anch" href="#"></a>
7 <a id="anch2" href="#"></a>
8 <input>
10 <script>
11 description('This tests that focus() and sequential focus navigation work on empty anchors.');
12 jsTestIsAsync = true;
13 var emptyAnchor1 = document.getElementById("anch");
14 var emptyAnchor2 = document.getElementById("anch2");
15 function test() {
16 emptyAnchor1.focus();
17 shouldBe('document.activeElement', 'emptyAnchor1');
19 testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true);
20 eventSender.keyDown('\t');
21 shouldBe('document.activeElement', 'emptyAnchor2');
22 finishJSTest();
24 </script>
25 </body>
26 </html>