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');
21 if (window
.testRunner
)
22 testRunner
.dumpAsText();
24 // Test for select that's not inside a form element
25 var menu1
= document
.getElementById('menu1');
28 if (window
.testRunner
) {
29 // change the option selection
30 eventSender
.keyDown('e');
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');
41 if (window
.testRunner
) {
42 // change the option selection
43 eventSender
.keyDown('e');
46 menu2
.dispatchEvent(enterEvent
);
50 <body onload=
"test()">
51 <p>This test verifies that the ENTER key fires the change event for popups.
</p>
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>
57 <pre id=
"console"></pre>