Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/special-key-events-in-input-text.html

Issue 2120153003: Remove keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_key_identifier_3a
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html><head></head> 1 <html><head></head>
2 <body> 2 <body>
3 <p>This test verifies that the correct sequence of keyboard events is generated for a keypress for certain special keys. To test manually, press keys and compar e results to other browsers.</p> 3 <p>This test verifies that the correct sequence of keyboard events is generated for a keypress for certain special keys. To test manually, press keys and compar e results to other browsers.</p>
4 <input type="text"></input> 4 <input type="text"></input>
5 <div id="log"></div> 5 <div id="log"></div>
6 6
7 <script> 7 <script>
8 function log(msg) { 8 function log(msg) {
9 document.getElementById("log").innerHTML+= msg + "<br>"; 9 document.getElementById("log").innerHTML+= msg + "<br>";
10 } 10 }
11 11
12 function logEvent(e) { 12 function logEvent(e) {
13 var target = e.target; 13 var target = e.target;
14 var type = e.type; 14 var type = e.type;
15 15
16 var info = target.tagName + " - " + type + ' - '; 16 var info = target.tagName + " - " + type + ' - ';
17 if (type == "textInput") { 17 if (type == "textInput") {
18 info += e.data; 18 info += e.data;
19 } else if (type == "keydown" || type == "keypress" || type == "keyup") { 19 } else if (type == "keydown" || type == "keypress" || type == "keyup") {
20 info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey] + 20 info += [e.ctrlKey, e.altKey, e.shiftKey, e.metaKey] +
21 ' - ' + e.keyIdentifier + 21 ' -' + e.key +
22 ' - ' + e.keyCode + 22 '- ' + e.keyCode +
23 ' - ' + e.charCode; 23 ' - ' + e.charCode;
24 } 24 }
25 info += '. Value: "' + target.value + '".'; 25 info += '. Value: "' + target.value + '".';
26 log(info); 26 log(info);
27 } 27 }
28 28
29 log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"] 29 log("target - type - " + ["ctrlKey", "altKey", "shiftKey", "metaKey"]
30 + ' - ' + "keyIdentifier" 30 + ' - ' + "key"
31 + ' - ' + "keyCode" 31 + ' - ' + "keyCode"
32 + ' - ' + "charCode"); 32 + ' - ' + "charCode");
33 33
34 var input = document.getElementsByTagName("input")[0]; 34 var input = document.getElementsByTagName("input")[0];
35 input.addEventListener('textInput', logEvent, false); 35 input.addEventListener('textInput', logEvent, false);
36 input.addEventListener('keypress', logEvent, false); 36 input.addEventListener('keypress', logEvent, false);
37 input.addEventListener('keydown', logEvent, false); 37 input.addEventListener('keydown', logEvent, false);
38 input.addEventListener('keyup', logEvent, false); 38 input.addEventListener('keyup', logEvent, false);
39 input.focus(); 39 input.focus();
40 40
(...skipping 13 matching lines...) Expand all
54 eventSender.keyDown("Backspace", []); 54 eventSender.keyDown("Backspace", []);
55 log("<br>Right parenthesis:"); 55 log("<br>Right parenthesis:");
56 eventSender.keyDown("0", ["shiftKey"]); 56 eventSender.keyDown("0", ["shiftKey"]);
57 log("<br>Backspace:"); 57 log("<br>Backspace:");
58 eventSender.keyDown("Backspace", []); 58 eventSender.keyDown("Backspace", []);
59 log("<br>Print screen:"); 59 log("<br>Print screen:");
60 eventSender.keyDown("PrintScreen", []); 60 eventSender.keyDown("PrintScreen", []);
61 } 61 }
62 </script> 62 </script>
63 </body></html> 63 </body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698