1 This test checks the behavior of the remove() method on the select.options object.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 1.1 Remove (object) from empty Options
7 PASS select1.options.remove(value) is undefined
8 PASS select1.options.length is 0
9 PASS select1.selectedIndex is -1
11 1.2 Remove (string) from empty Options
12 PASS select1.options.remove(value) is undefined
13 PASS select1.options.length is 0
14 PASS select1.selectedIndex is -1
16 1.3 Remove (float) from empty Options
17 PASS select1.options.remove(value) is undefined
18 PASS select1.options.length is 0
19 PASS select1.selectedIndex is -1
21 1.4 Remove (boolean) from empty Options
22 PASS select1.options.remove(value) is undefined
23 PASS select1.options.length is 0
24 PASS select1.selectedIndex is -1
26 1.5 Remove (undefined) from empty Options
27 PASS select1.options.remove(value) is undefined
28 PASS select1.options.length is 0
29 PASS select1.selectedIndex is -1
31 1.6 Remove (null) from empty Options
32 PASS select1.options.remove(value) is undefined
33 PASS select1.options.length is 0
34 PASS select1.selectedIndex is -1
36 1.7 Remove (negative infinity) from empty Options
37 PASS select1.options.remove(value) is undefined
38 PASS select1.options.length is 0
39 PASS select1.selectedIndex is -1
41 1.8 Remove (NaN) from empty Options
42 PASS select1.options.remove(value) is undefined
43 PASS select1.options.length is 0
44 PASS select1.selectedIndex is -1
46 1.9 Remove (positive infinity) from empty Options
47 PASS select1.options.remove(value) is undefined
48 PASS select1.options.length is 0
49 PASS select1.selectedIndex is -1
51 1.10 Remove no args from empty Options
52 PASS select1.options.remove() threw exception TypeError: Failed to execute 'remove' on 'HTMLOptionsCollection': 1 argument required, but only 0 present..
53 PASS select1.options.length is 0
54 PASS select1.selectedIndex is -1
56 1.11 Remove too many args from empty Options
57 PASS select1.options.remove(0, 'foo') is undefined
58 PASS select1.options.length is 0
59 PASS select1.selectedIndex is -1
61 1.12 Remove invalid index -2 from empty Options
62 PASS select1.options.remove(-2) is undefined
63 PASS select1.options.length is 0
64 PASS select1.selectedIndex is -1
66 1.13 Remove invalid index -1 from empty Options
67 PASS select1.options.remove(-1) is undefined
68 PASS select1.options.length is 0
69 PASS select1.selectedIndex is -1
71 1.14 Remove index 0 from empty Options
72 PASS select1.options.remove(0) is undefined
73 PASS select1.options.length is 0
74 PASS select1.selectedIndex is -1
76 1.15 Remove index 1 from empty Options
77 PASS select1.options.remove(1) is undefined
78 PASS select1.options.length is 0
79 PASS select1.selectedIndex is -1
81 1.16 Detach select element
82 PASS select1.parentNode is not null
83 PASS select1.remove() is undefined
84 PASS select1.parentNode is null
86 2.1 Remove (object) from non-empty Options
87 PASS select2.options.remove(value) is undefined
88 PASS select2.options.length is 15
89 PASS select2.selectedIndex is 13
90 PASS select2.options[0].value is 'B'
92 2.2 Remove (string) from non-empty Options
93 PASS select2.options.remove(value) is undefined
94 PASS select2.options.length is 14
95 PASS select2.selectedIndex is 12
96 PASS select2.options[0].value is 'C'
98 2.3 Remove (float) from non-empty Options
99 PASS select2.options.remove(value) is undefined
100 PASS select2.options.length is 13
101 PASS select2.selectedIndex is 11
102 PASS select2.options[3].value is 'G'
104 2.4 Remove (boolean true) from non-empty Options
105 PASS select2.options.remove(value) is undefined
106 PASS select2.options.length is 12
107 PASS select2.selectedIndex is 10
108 PASS select2.options[1].value is 'E'
110 2.5 Remove (boolean false) from non-empty Options
111 PASS select2.options.remove(value) is undefined
112 PASS select2.options.length is 11
113 PASS select2.selectedIndex is 9
114 PASS select2.options[1].value is 'G'
116 2.6 Remove (undefined) from non-empty Options
117 PASS select2.options.remove(value) is undefined
118 PASS select2.options.length is 10
119 PASS select2.selectedIndex is 8
120 PASS select2.options[0].value is 'G'
122 2.7 Remove (null) from non-empty Options
123 PASS select2.options.remove(value) is undefined
124 PASS select2.options.length is 9
125 PASS select2.selectedIndex is 7
126 PASS select2.options[0].value is 'H'
128 2.8 Remove (negative infinity) from non-empty Options
129 PASS select2.options.remove(value) is undefined
130 PASS select2.options.length is 8
131 PASS select2.selectedIndex is 6
132 PASS select2.options[0].value is 'I'
134 2.9 Remove (NaN) from non-empty Options
135 PASS select2.options.remove(value) is undefined
136 PASS select2.options.length is 7
137 PASS select2.selectedIndex is 5
138 PASS select2.options[0].value is 'J'
140 2.10 Remove (positive infinity) from non-empty Options
141 PASS select2.options.remove(value) is undefined
142 PASS select2.options.length is 6
143 PASS select2.selectedIndex is 4
144 PASS select2.options[0].value is 'K'
146 2.11 Remove no args from non-empty Options
147 PASS select2.options.remove() threw exception TypeError: Failed to execute 'remove' on 'HTMLOptionsCollection': 1 argument required, but only 0 present..
148 PASS select2.options.length is 6
149 PASS select2.selectedIndex is 4
150 PASS select2.options[0].value is 'K'
152 2.12 Remove too many args from non-empty Options
153 PASS select2.options.remove(0, 'foo') is undefined
154 PASS select2.options.length is 5
155 PASS select2.selectedIndex is 3
156 PASS select2.options[0].value is 'L'
158 2.13 Remove invalid index -2 from non-empty Options
159 PASS select2.options.remove(-2) is undefined
160 PASS select2.options.length is 5
161 PASS select2.selectedIndex is 3
162 PASS select2.options[2].value is 'N'
164 2.14 Remove invalid index -1 from non-empty Options
165 PASS select2.options.remove(-1) is undefined
166 PASS select2.options.length is 5
167 PASS select2.selectedIndex is 3
168 PASS select2.options[3].value is 'O'
170 2.15 Remove index 0 from non-empty Options
171 PASS select2.options.remove(0) is undefined
172 PASS select2.options.length is 4
173 PASS select2.selectedIndex is 2
174 PASS select2.options[0].value is 'M'
176 2.16 Remove index 1 from non-empty Options
177 PASS select2.options.remove(1) is undefined
178 PASS select2.options.length is 3
179 PASS select2.selectedIndex is 1
180 PASS select2.options[1].value is 'O'
182 2.17 Detach select element
183 PASS select2.parentNode is not null
184 PASS select2.remove() is undefined
185 PASS select2.parentNode is null
187 PASS successfullyParsed is true