Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / tabindex-defaults.html
blob48c6d5c1f4f5a4ccbe19284a7554db60e0ee8a89
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="container">
8 <!-- Focusable elements -->
9 <a id="anchor" href="tabindex-defaults.html">anchor</a>
10 <button id="button">button</button>
11 <input id="input">
12 <select id="select"></select>
13 <textarea id="textarea"></textarea>
14 <div id="editableDiv" contenteditable="true"></div>
16 <!-- Unfocusable element -->
17 <div id="normalDiv"></div>
18 </div>
20 <script>
21 description('Default value of tabIndex IDL attribute');
23 var anchor = document.getElementById('anchor');
24 var button = document.getElementById('button');
25 var input = document.getElementById('input');
26 var select = document.getElementById('select');
27 var textarea = document.getElementById('textarea');
28 var editableDiv = document.getElementById('editableDiv');
29 var normalDiv = document.getElementById('normalDiv');
31 shouldBe('anchor.tabIndex', '0');
32 shouldBe('button.tabIndex', '0');
33 shouldBe('input.tabIndex', '0');
34 shouldBe('select.tabIndex', '0');
35 shouldBe('textarea.tabIndex', '0');
36 shouldBe('editableDiv.tabIndex', '0');
37 shouldBe('normalDiv.tabIndex', '-1');
39 shouldBe('anchor.setAttribute("tabindex", "invalid"); anchor.tabIndex', '0');
40 shouldBe('button.setAttribute("tabindex", "invalid"); button.tabIndex', '0');
41 shouldBe('input.setAttribute("tabindex", "invalid"); input.tabIndex', '0');
42 shouldBe('select.setAttribute("tabindex", "invalid"); select.tabIndex', '0');
43 shouldBe('textarea.setAttribute("tabindex", "invalid"); textarea.tabIndex', '0');
44 shouldBe('editableDiv.setAttribute("tabindex", "invalid"); editableDiv.tabIndex', '0');
45 shouldBe('normalDiv.setAttribute("tabindex", "invalid"); normalDiv.tabIndex', '-1');
47 shouldBe('anchor.setAttribute("tabindex", "9999999999"); anchor.tabIndex', '0');
48 shouldBe('button.setAttribute("tabindex", "9999999999"); button.tabIndex', '0');
49 shouldBe('input.setAttribute("tabindex", "9999999999"); input.tabIndex', '0');
50 shouldBe('select.setAttribute("tabindex", "9999999999"); select.tabIndex', '0');
51 shouldBe('textarea.setAttribute("tabindex", "9999999999"); textarea.tabIndex', '0');
52 shouldBe('editableDiv.setAttribute("tabindex", "9999999999"); editableDiv.tabIndex', '0');
53 shouldBe('normalDiv.setAttribute("tabindex", "9999999999"); normalDiv.tabIndex', '-1');
55 document.getElementById('container').innerHTML = '';
56 </script>
57 </body>
58 </html>