summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/select_hr.html
blob: 957a99581616e74f478024abaaffbcee213e74ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<script>
    function getSelectInfo(myselect, mydiv) {
        var s = document.getElementById(myselect);
        var selectLength = s.length;
        var optionCollectionLength = s.options.length;
        var selectedInd = s.selectedIndex;
        var opt = s.options[selectedInd];
        var optText = "";
        
        if (opt) {
            optText = opt.innerHTML;
        }
        
        document.getElementById(mydiv).innerHTML = "Select length: " + selectLength + "<br>Option collection length: " + optionCollectionLength + "<br>Selected index: " + selectedInd + "<br>Selected option: " + optText;
    }
    
    function getAllInfo(x) {
        for (i = 1; i < x; i++) {
            var s = "s" + i;
            var d = "d" + i;
            
            getSelectInfo(s, d);
        }
    }
</script>


</head>
<body onload="getAllInfo(12)">
<p><b>BUG ID:</b> <a href="rdar://problem/4229189">4229189</a> add a way to get a separator into a select element</p>

<p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b> 
Please describe the steps required to test this bug here.
</p>


These tests make sure that adding an hr element in a select works properly.

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b>This should be a disabled popup menu, since the hr is not selectable. 
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b> </p>
<select id = "s1">
<hr>
</select>
<div id="d1"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: separator, option, separator
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s2">
<hr>
<option>opt 1</option>
<hr>
</select>
<div id="d2"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: option, separator, option
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s3">
<option>opt 1</option>
<hr>
<option>opt 2</option>
</select>
<div id="d3"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: option, four separators, two options, separator, option.
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s4">
<option>opt 1</option>
<hr>
<hr>
<hr>
<hr>
<option>opt 2</option>
<option>opt 3</option>
<hr>
<option>opt 4</option>
</select>
<div id="d4"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: group label, option, separator (incl. in group).
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s5">
<optgroup label="Group 1">
<option>opt 1</option>
<hr>
</optgroup>
</select>
<div id="d5"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: separator, group label, option.
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s6">
<hr>
<optgroup label="Group 1">
<option>opt 1</option>
</optgroup>
</select>
<div id="d6"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: group label, option, separator, option, separator, option, two separators, (end of group), one option.
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s7">
<optgroup label="Group 1">
<option>opt 1</option>
<hr>
<option>opt 2</option>
<hr>
<option>opt 3</option>
<hr>
<hr>
</optgroup>
<option>opt 4</option>
</select>
<div id="d7"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a popup menu with the following items: group label, one option two separators, (end of group), separator, group label, separator, two options, separator, (end of group), option.
</p>

<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s8">
<optgroup label="Group 1">
<option>opt 1</option>
<hr>
<hr>
</optgroup>
<hr>
<optgroup label="Group 2">
<hr>
<option>opt 2</option>
<option>opt 3</option>
<hr>
</optgroup>
<option>opt 4</option>
</select>
<div id="d8"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
A disabled popup menu - since the optgroup and the hr are not selectable.
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
</p>
<select id = "s9">
<optgroup label="Group 1">
<hr>
</optgroup>
</select>
<div id="d9"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a list box with the following items: 4 options.
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
You should not see any separators in the list box.</p>
<br><select id = "s10" multiple>
<option value="test">opt 1</option>
<hr>
<hr>
<hr>
<hr>
<option>opt 2</option>
<option>opt 3</option>
<hr>
<option>opt 4</option>
</select>
<div id="d10"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
You should see a list box with the following items: one option, group label, 3 options.
</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
You should not see any separators in the list box.</p>
<select id = "s11" multiple>
<option value="test">opt 1</option>
<hr>
<hr>
<optgroup label="Group 1">
<hr>
<hr>
<option>opt 2</option>
<option>opt 3</option>
<hr>
<option>opt 4</option>
</optgroup>
</select>
<div id="d11"></div>

<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
For each of these list boxes, when you change the selection in JavaScript to index 1, the second option should get highlighted</p>
<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
"opt 2" does not get highlighted after clicking the button.</p>

<select id="s12" multiple>
<option id="o3">opt 1</option>
<hr>
<option id="o4">opt 2</option>
</select>
<input type="button" value="Change selection to 'opt 2'" onclick="document.getElementById('s12').selectedIndex = 1;"></input>

<br><select id="s13" multiple>
<option id="o5">opt 1</option>
<hr>
<optgroup label="group">
<option id="o6">opt 2</option>
</optgroup>
</select>
<input type="button" value="Change selection to 'opt 2'" onclick="document.getElementById('s13').selectedIndex = 1;"></input>

<body>
</html>