Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(817)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/listbox-scroll-after-options-removed.html

Issue 1509853008: Move select/option/optgroup-related tests in fast/forms to fast/forms/select. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 function test()
5 {
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
9 }
10
11 setTimeout(test2, 0);
12 }
13
14 function test2()
15 {
16 var select = document.getElementById("listbox");
17 while (select.hasChildNodes())
18 select.removeChild(select.firstChild);
19
20 var option = document.createElement("option");
21 option.innerText = "Test Passed";
22 select.appendChild(option);
23
24 var scrollTop = select.scrollTop;
25 if (scrollTop == 0)
26 log("Test Passed");
27 else
28 log("Test Failed. scrollTop = " + scrollTop + " even though the re is only one option in the listbox");
29
30 if (window.testRunner)
31 testRunner.notifyDone();
32 }
33
34 function log(msg)
35 {
36 document.getElementById('console').appendChild(document.createTextNo de(msg + '\n'));
37 }
38 </script>
39 </head>
40 <body onload="test()">
41 <a href="http://bugs.webkit.org/show_bug.cgi?id=15252">Bug 15252: &lt;se lect multiple&gt; doesn't scroll to top when old options are removed and new one s are added, leaving listbox empty-looking</a>
42
43 <p>When the test runs, all the &lt;option&gt;s in the select are removed and replaced with 1 new option. If the bug is present, the select will appear e mpty until you scroll up with the mousewheel.</p>
44
45 <select id="listbox" size="4">
46 <option>1</option>
47 <option>2</option>
48 <option>3</option>
49 <option>4</option>
50 <option>5</option>
51 <option selected>6</option>
52 </select>
53 <pre id="console"></pre>
54 </body>
55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698