Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / var-name-conflict-in-form-event-handler.html
blob9036db62e6dd4b91e27f5b19e98b496900de189a
1 <html>
2 <body>
3 <p>This tests that a locally scoped variable in an event handler of a form
4 takes precedence over items of form.
6 <form>
7 <select onChange="var value = this.value;this.options[0].selected=true; if(value=='C') document.getElementById('sourceViewDiv').innerHTML='This test: PASSED!'">
8 <option value="A">A</option>
9 <option value="B">B</option>
10 <option value="C">C</option>
11 </select>
13 <div id='sourceViewDiv'>This test: FAILED</div>
15 <script>
16 if (window.testRunner)
17 testRunner.dumpAsText();
19 var x=document.getElementsByTagName('select')[0];
20 x.options[2].selected=true;
21 var evt = document.createEvent("HTMLEvents");
22 evt.initEvent("change", true, true);
23 x.dispatchEvent(evt);
24 </script>
25 </form>
27 </body>
28 </html>