OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <link rel="help" href="http://www.w3.org/TR/html51/forms.html#dom-select-item"> |
| 5 <script src="../../js/resources/js-test-pre.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <select id="target"> |
| 9 <option value="a">a</option> |
| 10 <option value="b">b</option> |
| 11 <option value="c">c</option> |
| 12 <option value="d">d</option> |
| 13 </select> |
| 14 |
| 15 <script> |
| 16 description("Tests that the HTMLSelectElement.item() argument is correctly valid
ated."); |
| 17 |
| 18 var select = document.getElementById('target'); |
| 19 shouldBe("select.__proto__", "HTMLSelectElement.prototype"); |
| 20 |
| 21 // getter Node item(unsigned long index); |
| 22 shouldBeEqualToString("select.item(0).value", "a"); |
| 23 shouldBeEqualToString("select.item(1).value", "b"); |
| 24 shouldBeEqualToString("select.item(2).value", "c"); |
| 25 shouldBeEqualToString("select.item(3).value", "d"); |
| 26 shouldBeNull("select.item(4)"); |
| 27 shouldBeNull("select.item(-1)"); // Offset is too large (after wrapping) |
| 28 shouldBeEqualToString("select.item(-4294967294).value", "c"); // Wraps to 2, whi
ch is a valid offset. |
| 29 shouldThrow("select.item()", "'TypeError: Not enough arguments'"); |
| 30 |
| 31 </script> |
| 32 <script src="../../js/resources/js-test-post.js"></script> |
| 33 </body> |
| 34 </html> |
OLD | NEW |