Bug 1940304 - Fix browser_sidebar_button_reset.js intermittent r=sidebar-reviewers...
[gecko.git] / layout / reftests / forms / select / out-of-bounds-selectedindex.html
blob4ae9ed06b6ccfd447a1044e046944b003c1b4079
1 <html class="reftest-wait">
2 <head><title>Testcase for bug 471741</title>
3 <script>
4 var result = "Result: "
5 function sel(id,index) {
6 var el = document.getElementById(id)
7 el.selectedIndex = index;
8 result += el.selectedIndex + ' ';
11 </script>
12 </head>
13 <body id="body">
14 <select size="4" id="m1" multiple="multiple">
15 <option value="Item0">Item0</option>
16 <option selected="selected" value="Item1">Item1</option>
17 <option value="Item2">Item2</option>
18 <option value="Item3">Item3</option>
19 <option value="Item4">Item4</option>
20 </select>
21 <select size="1" id="s1">
22 <option value="Item0">Item0</option>
23 <option selected="selected" value="Item1">Item1</option>
24 <option value="Item2">Item2</option>
25 <option value="Item3">Item3</option>
26 <option value="Item4">Item4</option>
27 </select>
29 <select size="4" id="m2" multiple="multiple">
30 <option value="Item0">Item0</option>
31 </select>
32 <select size="1" id="s2">
33 <option value="Item0">Item0</option>
34 </select>
36 <select size="4" id="m3" multiple="multiple"></select>
37 <select size="1" id="s3"></select>
38 <br>
40 <select size="4" id="r2m1" multiple="multiple">
41 <option value="Item0">Item0</option>
42 <option selected="selected" value="Item1">Item1</option>
43 <option value="Item2">Item2</option>
44 <option value="Item3">Item3</option>
45 <option value="Item4">Item4</option>
46 </select>
47 <select size="1" id="r2s1">
48 <option value="Item0">Item0</option>
49 <option selected="selected" value="Item1">Item1</option>
50 <option value="Item2">Item2</option>
51 <option value="Item3">Item3</option>
52 <option value="Item4">Item4</option>
53 </select>
55 <select size="4" id="r2m2" multiple="multiple">
56 <option value="Item0">Item0</option>
57 </select>
58 <select size="1" id="r2s2">
59 <option value="Item0">Item0</option>
60 </select>
62 <select size="4" id="r2m3" multiple="multiple"></select>
63 <select size="1" id="r2s3"></select>
64 <br>
66 <select size="4" id="r3m1" multiple="multiple">
67 <option value="Item0">Item0</option>
68 <option selected="selected" value="Item1">Item1</option>
69 <option value="Item2">Item2</option>
70 <option value="Item3">Item3</option>
71 <option value="Item4">Item4</option>
72 </select>
73 <select size="1" id="r3s1">
74 <option value="Item0">Item0</option>
75 <option selected="selected" value="Item1">Item1</option>
76 <option value="Item2">Item2</option>
77 <option value="Item3">Item3</option>
78 <option value="Item4">Item4</option>
79 </select>
81 <select size="4" id="r3m2" multiple="multiple">
82 <option value="Item0">Item0</option>
83 </select>
84 <select size="1" id="r3s2">
85 <option value="Item0">Item0</option>
86 </select>
88 <select size="4" id="r3m3" multiple="multiple"></select>
89 <select size="1" id="r3s3"></select>
90 <br>
92 <div id="result"></div>
94 <script>
95 sel('m1', 10)
96 sel('s1', 10)
97 sel('m2', 99999)
98 sel('s2', 99999)
99 sel('m3', 10)
100 sel('s3', 10)
102 sel('r2m1', -2)
103 sel('r2s1', -2)
104 sel('r2m2', -12)
105 sel('r2s2', -12)
106 sel('r2m3', -2)
107 sel('r2s3', -2)
109 sel('r3m1', -2)
110 sel('r3s1', -2)
111 sel('r3m2', -12)
112 sel('r3s2', -12)
113 sel('r3m3', -2)
114 sel('r3s3', -2)
115 sel('r3m1', 0)
116 sel('r3s1', 0)
117 sel('r3m2', 0)
118 sel('r3s2', 0)
119 sel('r3m3', 0)
120 sel('r3s3', 0)
122 document.getElementById('result').innerHTML = result;
124 var flush = document.documentElement.offsetHeight;
125 document.documentElement.className='';
127 </script>
128 </body>
129 </html>