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

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

Issue 20986003: Define DOM_KEY_LOCATION_* constants on KeyboardEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/js-keyboard-event-creation.html
diff --git a/LayoutTests/fast/events/js-keyboard-event-creation.html b/LayoutTests/fast/events/js-keyboard-event-creation.html
index f1526e57f16266adad526f614706c415cb802c68..e39814cb1bbb091ec154405a1e586b12d31615d9 100644
--- a/LayoutTests/fast/events/js-keyboard-event-creation.html
+++ b/LayoutTests/fast/events/js-keyboard-event-creation.html
@@ -2,9 +2,29 @@
<head>
<script>
+function keyLocationToText(location)
+{
+ switch (location) {
+ case KeyboardEvent.DOM_KEY_LOCATION_STANDARD:
+ return "DOM_KEY_LOCATION_STANDARD";
+ case KeyboardEvent.DOM_KEY_LOCATION_LEFT:
+ return "DOM_KEY_LOCATION_LEFT";
+ case KeyboardEvent.DOM_KEY_LOCATION_RIGHT:
+ return "DOM_KEY_LOCATION_RIGHT";
+ case KeyboardEvent.DOM_KEY_LOCATION_NUMPAD:
+ return "DOM_KEY_LOCATION_NUMPAD";
+ case KeyboardEvent.DOM_KEY_LOCATION_MOBILE:
+ return "DOM_KEY_LOCATION_MOBILE";
+ case KeyboardEvent.DOM_KEY_LOCATION_JOYSTICK:
+ return "DOM_KEY_LOCATION_JOYSTICK";
+ default:
+ return "" + location
+ }
+}
+
function keyevent(event) {
var p = document.createElement("p");
- p.appendChild(document.createTextNode(event.type + " - key: " + event.keyIdentifier + "@" + event.location + " (keyCode/charCode: " + event.keyCode + "/" + event.charCode + ")" + " modifiers: " + event.ctrlKey + "," + event.altKey + "," + event.shiftKey + "," + event.metaKey));
+ p.appendChild(document.createTextNode(event.type + " - key: " + event.keyIdentifier + "@" + keyLocationToText(event.location) + " (keyCode/charCode: " + event.keyCode + "/" + event.charCode + ")" + " modifiers: " + event.ctrlKey + "," + event.altKey + "," + event.shiftKey + "," + event.metaKey));
document.getElementById("result").appendChild(p);
}

Powered by Google App Engine
This is Rietveld 408576698