| | 31 | <p> |
|---|
| | 32 | <input type="button" name="enabled" value="enabled" id="enabled"> |
|---|
| | 33 | <input type="button" name="disabled" value="disabled" id="disabled" disabled="1" /> |
|---|
| | 34 | <input type="checkbox" name="checked" value="checked" id="checked" checked="1" /> |
|---|
| | 35 | </p> |
|---|
| | 36 | </div> |
|---|
| | 37 | |
|---|
| | 38 | <div id="sequence"> |
|---|
| | 39 | <a href="http://www.example.com/link1">Link 1</a> |
|---|
| | 40 | <a href="http://www.example.com/link2">Link 2</a> |
|---|
| | 41 | <a href="http://www.example.com/link3">Link 3</a> |
|---|
| | 42 | <a href="http://www.example.com/link4">Link 4</a> |
|---|
| | 43 | <p>Something else</p> |
|---|
| | 44 | <a href="http://www.example.com/link5">Link 5</a> |
|---|
| | 45 | <a href="http://www.example.com/link6">Link 6</a> |
|---|
| | 46 | <a href="http://www.example.com/link7">Link 7</a> |
|---|
| | 47 | <a href="http://www.example.com/link8">Link 8</a> |
|---|
| 49 | | 'http://www.example.com/insidespan']; |
|---|
| | 66 | 'http://www.example.com/insidespan', |
|---|
| | 67 | 'http://www.example.com/link1', |
|---|
| | 68 | 'http://www.example.com/link2', |
|---|
| | 69 | 'http://www.example.com/link3', |
|---|
| | 70 | 'http://www.example.com/link4', |
|---|
| | 71 | 'http://www.example.com/link5', |
|---|
| | 72 | 'http://www.example.com/link6', |
|---|
| | 73 | 'http://www.example.com/link7', |
|---|
| | 74 | 'http://www.example.com/link8']; |
|---|
| 60 | | 'http://www.example.com/insidespan']; |
|---|
| | 85 | 'http://www.example.com/insidespan', |
|---|
| | 86 | 'http://www.example.com/link1', |
|---|
| | 87 | 'http://www.example.com/link2', |
|---|
| | 88 | 'http://www.example.com/link3', |
|---|
| | 89 | 'http://www.example.com/link4', |
|---|
| | 90 | 'http://www.example.com/link5', |
|---|
| | 91 | 'http://www.example.com/link6', |
|---|
| | 92 | 'http://www.example.com/link7', |
|---|
| | 93 | 'http://www.example.com/link8']; |
|---|
| 85 | | 'http://www.example.com/insidespan']; |
|---|
| | 118 | 'http://www.example.com/insidespan', |
|---|
| | 119 | 'http://www.example.com/link1', |
|---|
| | 120 | 'http://www.example.com/link2', |
|---|
| | 121 | 'http://www.example.com/link3', |
|---|
| | 122 | 'http://www.example.com/link4', |
|---|
| | 123 | 'http://www.example.com/link5', |
|---|
| | 124 | 'http://www.example.com/link6', |
|---|
| | 125 | 'http://www.example.com/link7', |
|---|
| | 126 | 'http://www.example.com/link8']; |
|---|
| 123 | | expected = ['http://groups.google.com/']; |
|---|
| | 164 | expected = ['http://groups.google.com/', |
|---|
| | 165 | 'http://www.example.com/link2', |
|---|
| | 166 | 'http://www.example.com/link3', |
|---|
| | 167 | 'http://www.example.com/link4', |
|---|
| | 168 | 'http://www.example.com/link6', |
|---|
| | 169 | 'http://www.example.com/link7', |
|---|
| | 170 | 'http://www.example.com/link8']; |
|---|
| | 174 | expected = ['http://www.example.com/link1', |
|---|
| | 175 | 'http://www.example.com/link3', |
|---|
| | 176 | 'http://www.example.com/link6', |
|---|
| | 177 | 'http://www.example.com/link8']; |
|---|
| | 178 | results = $$('#sequence a:nth-child(odd)'); |
|---|
| | 179 | testExpected(results, expected, "'#sequence a:nth-child(odd)' selector"); |
|---|
| | 180 | |
|---|
| | 181 | expected = ['http://www.example.com/link1', |
|---|
| | 182 | 'http://www.example.com/link3', |
|---|
| | 183 | 'http://www.example.com/link5', |
|---|
| | 184 | 'http://www.example.com/link7']; |
|---|
| | 185 | results = $$('#sequence a:nth-of-type(odd)'); |
|---|
| | 186 | testExpected(results, expected, "'#sequence a:nth-of-type(odd)' selector"); |
|---|
| | 187 | |
|---|
| | 188 | expected = ['http://www.example.com/link1', |
|---|
| | 189 | 'http://www.example.com/link4', |
|---|
| | 190 | 'http://www.example.com/link7']; |
|---|
| | 191 | results = $$('#sequence a:nth-of-type(3n+1)'); |
|---|
| | 192 | testExpected(results, expected, "'#sequence a:nth-of-type(3n+1)' selector"); |
|---|
| | 193 | |
|---|
| | 194 | expected = ['http://www.example.com/link5']; |
|---|
| | 195 | results = $$('#sequence a:nth-child(6)'); |
|---|
| | 196 | testExpected(results, expected, "'#sequence a:nth-child(6)' selector"); |
|---|
| | 197 | |
|---|
| | 198 | expected = ['http://www.example.com/link5']; |
|---|
| | 199 | results = $$('#sequence a:nth-of-type(5)'); |
|---|
| | 200 | testExpected(results, expected, "'#sequence a:nth-of-type(5)' selector"); |
|---|
| | 201 | |
|---|
| | 202 | expected = [$('enabled'), $('checked')]; |
|---|
| | 203 | results = $$('body :enabled'); |
|---|
| | 204 | for (var i=0; i < results.length; i ++) { |
|---|
| | 205 | is( results[i], expected[i], "'body :enabled" + ' (' + i + ')'); |
|---|
| | 206 | } |
|---|
| | 207 | |
|---|
| | 208 | expected = [$('disabled')]; |
|---|
| | 209 | results = $$('body :disabled'); |
|---|
| | 210 | for (var i=0; i < results.length; i ++) { |
|---|
| | 211 | is( results[i], expected[i], "'body :disabled" + ' (' + i + ')'); |
|---|
| | 212 | } |
|---|
| | 213 | |
|---|
| | 214 | expected = [$('checked')]; |
|---|
| | 215 | results = $$('body :checked'); |
|---|
| | 216 | for (var i=0; i < results.length; i ++) { |
|---|
| | 217 | is( results[i], expected[i], "'body :checked" + ' (' + i + ')'); |
|---|
| | 218 | } |
|---|
| | 219 | |
|---|