| OLD | NEW |
| 1 <select id="test" size="3"> | 1 <select id="test" size="3"> |
| 2 </select> | 2 </select> |
| 3 <div id="console"></div> | 3 <div id="console"></div> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function reset(mySelect) { | 6 function reset(mySelect) { |
| 7 mySelect.length = 0; | 7 mySelect.length = 0; |
| 8 mySelect.options[mySelect.length] = new Option("one", "value", true, true); | 8 mySelect.options[mySelect.length] = new Option("one", "value", true, true); |
| 9 mySelect.options[mySelect.length] = new Option("two", "value", true, true); | 9 mySelect.options[mySelect.length] = new Option("two", "value", true, true); |
| 10 } | 10 } |
| 11 | 11 |
| 12 var mySelect = document.getElementById("test"); | 12 var mySelect = document.getElementById("test"); |
| 13 reset(mySelect); | 13 reset(mySelect); |
| 14 var i = 0; | 14 var i = 0; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 shouldBe("mySelect.options.length", "10"); | 132 shouldBe("mySelect.options.length", "10"); |
| 133 shouldBe("mySelect.selectedIndex", "-1"); | 133 shouldBe("mySelect.selectedIndex", "-1"); |
| 134 | 134 |
| 135 debug((++i) + ") trying to set a option element using an invalid index: positive
infinity"); | 135 debug((++i) + ") trying to set a option element using an invalid index: positive
infinity"); |
| 136 mySelect.options[1/0] = document.createElement("option"); | 136 mySelect.options[1/0] = document.createElement("option"); |
| 137 shouldBe("mySelect.options.length", "10"); | 137 shouldBe("mySelect.options.length", "10"); |
| 138 shouldBe("mySelect.selectedIndex", "-1"); | 138 shouldBe("mySelect.selectedIndex", "-1"); |
| 139 | 139 |
| 140 debug(""); | 140 debug(""); |
| 141 </script> | 141 </script> |
| OLD | NEW |