6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
16 var select
= document
.getElementById("listbox");
17 while (select
.hasChildNodes())
18 select
.removeChild(select
.firstChild
);
20 var option
= document
.createElement("option");
21 option
.innerText
= "Test Passed";
22 select
.appendChild(option
);
24 var scrollTop
= select
.scrollTop
;
28 log("Test Failed. scrollTop = " + scrollTop
+ " even though there is only one option in the listbox");
30 if (window
.testRunner
)
31 testRunner
.notifyDone();
36 document
.getElementById('console').appendChild(document
.createTextNode(msg
+ '\n'));
40 <body onload=
"test()">
41 <a href=
"http://bugs.webkit.org/show_bug.cgi?id=15252">Bug
15252:
<select multiple
> doesn't scroll to top when old options are removed and new ones are added, leaving listbox empty-looking
</a>
43 <p>When the test runs, all the
<option
>s in the select are removed and replaced with
1 new option. If the bug is present, the select will appear empty until you scroll up with the mousewheel.
</p>
45 <select id=
"listbox" size=
"4">
51 <option selected
>6</option>
53 <pre id=
"console"></pre>