Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / select-change-popup-to-listbox-roundtrip.html
blob87db8266489090a9a1143b3fb6d47101021f075a
1 <html>
2 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
9 function runTest()
11 var s1 = document.getElementById("s1");
12 s1.size = 1;
13 s1.size = 5;
15 var s2 = document.getElementById("s2");
16 s2.size = 1;
17 // force layout.
18 document.body.offsetTop;
19 s2.size = 5;
21 var s3 = document.getElementById("s3");
22 s3.size = 1;
23 setTimeout(function()
25 s3.size = 5;
26 reportResults();
27 }, 0);
30 function reportResults()
32 var selected1 = s1.selectedIndex;
33 var selected2 = s2.selectedIndex;
34 var selected3 = s3.selectedIndex;
35 document.getElementById("test").innerHTML = "<ul>" +
36 "<li>Changing the size of a select element from 5 to 1 and back 5 should acquire selection of the first item: " + (selected1 == 0 ? "PASS" : "FAIL") +
37 "<li>Forcing layout should not affect the outcome: " + (selected2 == selected1 ? "PASS" : "FAIL") +
38 "<li>And neither should dropping out of the message loop: " + (selected3 == selected1 ? "PASS" : "FAIL") +
39 "</ul>";
41 if (window.testRunner)
42 testRunner.notifyDone();
45 </script>
46 <body onload="runTest()">
47 <div id="test">
48 <select id="s1" size="5"><option>test</select>
49 <select id="s2" size="5"><option>test</select>
50 <select id="s3" size="5"><option>test</select>
51 </div>
52 </body>