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); |
} |