diff options
Diffstat (limited to 'Source/WebCore/manual-tests/select-option-in-onload.html')
-rw-r--r-- | Source/WebCore/manual-tests/select-option-in-onload.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/WebCore/manual-tests/select-option-in-onload.html b/Source/WebCore/manual-tests/select-option-in-onload.html new file mode 100644 index 0000000..3a4d8a6 --- /dev/null +++ b/Source/WebCore/manual-tests/select-option-in-onload.html @@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> +<html> + <head> + <title>Programmatically selected popup item not shown</title> + <script type="text/javascript"> + function testMyPopup() { + var myPopup = document.getElementById('testPopup'); + for (var i = 0; i < myPopup.options.length; i++) { + if (myPopup.options[i].value == "2") + myPopup.options[i].selected = true; + } + } + </script> + </head> + <!--body--> + <body onload="testMyPopup();"> + <p>The popup below has the item "FAIL" selected by default in the html, but a javascript function + triggered from the body's onload changed it to "PASS" (assuming you saw an alert telling you so).</p> + <p>Problem: In old versions of WebKit the change was not visible until you click on the popup.</p> + <form action="get"> + <select id="testPopup"> + <option value="0"></option> + <option value="1">One</option> + <option value="2">PASS</option> + <option value="3" selected="selected">FAIL</option> + </select> + </form> + </body> +</html> |