summaryrefslogtreecommitdiffstats
path: root/WebCore/manual-tests/select-onchange-after-js.html
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/manual-tests/select-onchange-after-js.html
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/manual-tests/select-onchange-after-js.html')
-rw-r--r--WebCore/manual-tests/select-onchange-after-js.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/WebCore/manual-tests/select-onchange-after-js.html b/WebCore/manual-tests/select-onchange-after-js.html
new file mode 100644
index 0000000..4cdea0a
--- /dev/null
+++ b/WebCore/manual-tests/select-onchange-after-js.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<body>
+ <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11402">bug 11402</a> and
+ <a href="http://bugs.webkit.org/show_bug.cgi?id=12701">bug 12701</a>:
+ An onChange event should fire when the first item is not the default, and
+ after changing the value via JavaScript.</p>
+ <p>After following the steps below, both selects should display "SUCCESS".</p>
+
+ <form action="" method="post" name="areaform" id="areaform">
+ <select name="selectitem" onChange="onChange1(this)">
+ <option value="1">Please change this to another value</option>
+ <option value="2">(to this one)</option>
+ </select>
+ </form>
+ <form action="" method="post" name="areaform2" id="areaform2">
+ <select name="selectitem2" onChange="onChange2(this)">
+ <option value="1">(to this one)</option>
+ <option value="2" selected>Please change this to another value</option>
+ </select>
+ </form>
+
+ <script>
+ function onChange1(sel) {
+ if (sel.secondTry) {
+ sel.options[1].text='SUCCESS';
+ } else {
+ sel.options[0].text='Please change this to another value once again';
+ sel.value = '1';
+ sel.secondTry = 1;
+ }
+ }
+
+ function onChange2(sel) {
+ if (sel.secondTry) {
+ sel.options[0].text='SUCCESS';
+ } else {
+ sel.options[1].text='Please change this to another value once again';
+ document.forms.areaform2.selectitem2.options[1].selected = true;
+ sel.secondTry = 1;
+ }
+ }
+ </script>
+
+</body>
+</html>