Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / onchange-select-popup.html
blobbd3d2e231cc897518a4e928ba6436a724bdc841e
1 <html>
2 <head>
3 <script>
4 function log(s)
6 document.getElementById('console').appendChild(document.createTextNode(s + "\n"));
9 function changeHandler()
11 log ('PASS: change event fired.\n');
14 function blurHandler()
16 log ('blur event fired.\n');
19 function test()
21 if (window.testRunner)
22 testRunner.dumpAsText();
24 // Test for select that's not inside a form element
25 var menu1 = document.getElementById('menu1');
26 menu1.focus();
28 if (window.testRunner) {
29 // change the option selection
30 eventSender.keyDown('e');
32 // hit enter
33 var enterEvent = document.createEvent("KeyboardEvents");
34 enterEvent.initKeyboardEvent("keypress", true, false, window, "Enter", 0, false, false, false, false, false);
35 menu1.dispatchEvent(enterEvent);
37 // Test for select is inside a form element
38 var menu2 = document.getElementById('menu2');
39 menu2.focus();
41 if (window.testRunner) {
42 // change the option selection
43 eventSender.keyDown('e');
45 // hit enter
46 menu2.dispatchEvent(enterEvent);
48 </script>
49 </head>
50 <body onload="test()">
51 <p>This test verifies that the ENTER key fires the change event for popups.</p>
52 <hr>
53 <select id="menu1" onchange="changeHandler()" onblur="blurHandler()"><option>abcd</option><option>efgh</option></select>
54 <form onsubmit="return false;">
55 <select id="menu2" onchange="changeHandler()" onblur="blurHandler()"><option>abcd</option><option>efgh</option></select>
56 </form>
57 <pre id="console"></pre>
58 </body>
59 </html>