Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLOptionElement / set-option-index-text.html
blob5390a9df84a8ae7d7d57e34163e10893ee9e9915
1 <p>"Option 1" and "Option 2" should be in correct order.</p>
2 <select size=2>
3 <option>ERROR</option>
4 <option>Option 2</option>
5 </select>
6 <script>
7 if (window.testRunner)
8 testRunner.dumpAsText();
10 var option1 = document.getElementsByTagName("option")[0];
11 var option2 = document.getElementsByTagName("option")[1];
13 option1.text = "Option 1";
14 try {
15 option1.index = 1;
16 if (option1.index != 0)
17 document.write("<p>FAIL: An attempt to set HTMLOptionElement.index was not ignored.");
19 if (window.testRunner) {
20 document.write(document.getElementsByTagName("option")[0].text + "<br>");
21 document.write(document.getElementsByTagName("option")[1].text + "<br>");
23 } catch (ex) {
24 document.write("<p>FAIL: Exception on setting an index: " + ex + "</p>");
26 </script>