Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / key-events-in-input-button.html
blobc03eee49c081d3407bee8d4dc5a8d4f0299d3c33
1 <p>To test manually, press keys and compare results to other browsers.</p>
2 <input type="button" value="Input"
3 onclick="log(eventInfo(event));"
4 onmousedown="log(eventInfo(event));"
5 onmouseup="log(eventInfo(event));"
6 onkeypress="log(eventInfo(event));"
7 onkeydown="log(eventInfo(event));"
8 onkeyup="log(eventInfo(event));">
9 </input>
10 <div id="log"></div>
12 <script>
13 function log(msg) {
14 document.getElementById("log").innerHTML+= msg + "<br />";
16 function eventInfo(event, where) {
17 try {
18 if (!event)
19 event = window.event;
20 target = event.srcElement ? event.srcElement : event.target;
21 if (event.type == "textInput")
22 return (where ? "(" + where + ") " : "") + target.tagName + " - " + event.type + " - " + event.data;
23 else if (event.type == "keydown" || event.type == "keypress" || event.type == "keyup")
24 return (where ? "(" + where + ") " : "") + target.tagName + " - " + event.type
25 + ' - ' + [event.ctrlKey, event.altKey, event.shiftKey, event.metaKey]
26 + ' - ' + event.keyIdentifier
27 + ' - ' + event.keyCode
28 + ' - ' + event.charCode;
29 else if (event.type == "mousedown" || event.type == "click" || event.type == "mouseup")
30 return (where ? "(" + where + ") " : "") + target.tagName + " - " + event.type;
32 } catch (ex) {
33 alert(ex);
36 log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
37 + ' - ' + "keyIdentifier"
38 + ' - ' + "keyCode"
39 + ' - ' + "charCode");
41 if (document.getElementsByTagName("input")[0].addEventListener)
42 document.getElementsByTagName("input")[0].addEventListener('textInput', function(e) {log(eventInfo(e));}, false);
44 document.getElementsByTagName("input")[0].focus();
46 if (window.testRunner) {
47 testRunner.dumpAsText();
48 log("Space:");
49 eventSender.keyDown(" ", []);
50 log("Enter:");
51 eventSender.keyDown("\r", []);
52 log("A:");
53 eventSender.keyDown("A", []);
55 </script>