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

Side by Side Diff: LayoutTests/fast/events/js-keyboard-event-creation.html

Issue 20034002: Add support for KeyboardEvent.location attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 4
5 function keyevent(event) { 5 function keyevent(event) {
6 var p = document.createElement("p"); 6 var p = document.createElement("p");
7 p.appendChild(document.createTextNode(event.type + " - key: " + event.keyIde ntifier + "@" + event.keyLocation + " (keyCode/charCode: " + event.keyCode + "/" + event.charCode + ")" + " modifiers: " + event.ctrlKey + "," + event.altKey + "," + event.shiftKey + "," + event.metaKey)); 7 p.appendChild(document.createTextNode(event.type + " - key: " + event.keyIde ntifier + "@" + event.location + " (keyCode/charCode: " + event.keyCode + "/" + event.charCode + ")" + " modifiers: " + event.ctrlKey + "," + event.altKey + "," + event.shiftKey + "," + event.metaKey));
8 document.getElementById("result").appendChild(p); 8 document.getElementById("result").appendChild(p);
9 } 9 }
10 10
11 function init() { 11 function init() {
12 var input = document.getElementById("testinput"); 12 var input = document.getElementById("testinput");
13 input.addEventListener("keydown", keyevent, true); 13 input.addEventListener("keydown", keyevent, true);
14 input.addEventListener("keypress", keyevent, true); 14 input.addEventListener("keypress", keyevent, true);
15 input.addEventListener("keyup", keyevent, true); 15 input.addEventListener("keyup", keyevent, true);
16 16
17 if (window.testRunner) 17 if (window.testRunner)
(...skipping 11 matching lines...) Expand all
29 <form> 29 <form>
30 <input type="text" size="50" id="testinput" /> 30 <input type="text" size="50" id="testinput" />
31 <input type="text" size="50" /> 31 <input type="text" size="50" />
32 </form> 32 </form>
33 33
34 <p>This tests that DOMKeyboardEvents are created correctly in the JavaScript API.</p> 34 <p>This tests that DOMKeyboardEvents are created correctly in the JavaScript API.</p>
35 35
36 <div id="result"></div> 36 <div id="result"></div>
37 </body> 37 </body>
38 </html> 38 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/init-events-expected.txt ('k') | LayoutTests/fast/events/keydown-leftright-keys.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698