5 document
.getElementById('log').appendChild(document
.createTextNode(msg
+ '\n'));
8 function logTabIndex(elem
) {
9 log('getAttribute("tabindex") = ' + elem
.getAttribute('tabindex') + '; tabIndex = ' + elem
.tabIndex
);
13 if (window
.testRunner
) {
14 testRunner
.dumpAsText();
17 log('Testing input elements in the page');
19 var inputs
= document
.getElementsByTagName('input');
20 for (var i
= 0; i
< inputs
.length
; ++i
) {
21 logTabIndex(inputs
[i
]);
24 var indices
= [40000, 32768, 32767, 32766, 0, -1, -32767, -32768, -40000];
26 log('Testing setAttribute on an anchor element made with document.createElement');
28 var elem
= document
.createElement('a');
29 for (var i
= 0; i
< indices
.length
; ++i
) {
30 elem
.setAttribute('tabindex', indices
[i
]);
34 log('Testing tabIndex on an area element made with document.createElement');
36 var elem
= document
.createElement('area');
37 for (var i
= 0; i
< indices
.length
; ++i
) {
38 elem
.tabIndex
= indices
[i
];
44 <body onload=
"test()">
45 <p>This page tests that the
<tt>tabindex
</tt> attribute is clamped to
46 values between -
32768 and
32767. Values outside of this range should be
47 clamped to the range limits.
</p>
49 <input tabindex=
"40000">
50 <input tabindex=
"32768">
51 <input tabindex=
"32767">
52 <input tabindex=
"32766">
55 <input tabindex=
"-32767">
56 <input tabindex=
"-32768">
57 <input tabindex=
"-32769">
58 <input tabindex=
"-40000">