Index: core/events/KeyboardEvent.idl |
diff --git a/core/events/KeyboardEvent.idl b/core/events/KeyboardEvent.idl |
index ca68d367b11da44762ffd95436da0110eaed41f0..a83b365d266ad32c0f749659f2db6e1953b39bb3 100644 |
--- a/core/events/KeyboardEvent.idl |
+++ b/core/events/KeyboardEvent.idl |
@@ -18,35 +18,47 @@ |
* Boston, MA 02110-1301, USA. |
*/ |
+// https://w3c.github.io/uievents/#interface-KeyboardEvent |
+ |
[ |
- EventConstructor, |
+ Constructor(DOMString type, optional KeyboardEventInit eventInitDict), |
+ ConstructorCallWith=ScriptState, |
] interface KeyboardEvent : UIEvent { |
+ // KeyLocationCode |
const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; |
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; |
const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; |
const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; |
+ [RuntimeEnabled=KeyboardEventKey] readonly attribute DOMString key; |
+ [RuntimeEnabled=KeyboardEventCode] readonly attribute DOMString code; |
+ readonly attribute unsigned long location; |
+ readonly attribute boolean ctrlKey; |
+ readonly attribute boolean shiftKey; |
+ readonly attribute boolean altKey; |
+ readonly attribute boolean metaKey; |
+ readonly attribute boolean repeat; |
+ // TODO(philipj): readonly attribute boolean isComposing; |
+ boolean getModifierState(DOMString keyArg); |
- [InitializedByEventConstructor] readonly attribute DOMString keyIdentifier; |
- [InitializedByEventConstructor] readonly attribute unsigned long location; |
- [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation, InitializedByEventConstructor] readonly attribute unsigned long keyLocation; // Deprecated. |
- [InitializedByEventConstructor] readonly attribute boolean ctrlKey; |
- [InitializedByEventConstructor] readonly attribute boolean shiftKey; |
- [InitializedByEventConstructor] readonly attribute boolean altKey; |
- [InitializedByEventConstructor] readonly attribute boolean metaKey; |
- [InitializedByEventConstructor] readonly attribute boolean repeat; |
+ // https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers |
+ // FIXME: this does not match the version in the spec. |
+ [CallWith=ScriptState, Measure] void initKeyboardEvent([Default=Undefined] optional DOMString type, |
+ [Default=Undefined] optional boolean bubbles, |
+ [Default=Undefined] optional boolean cancelable, |
+ [Default=Undefined] optional Window view, |
+ [Default=Undefined] optional DOMString keyIdentifier, |
+ [Default=Undefined] optional unsigned long location, |
+ [Default=Undefined] optional boolean ctrlKey, |
+ [Default=Undefined] optional boolean altKey, |
+ [Default=Undefined] optional boolean shiftKey, |
+ [Default=Undefined] optional boolean metaKey); |
- boolean getModifierState(DOMString keyArgument); |
+ // https://w3c.github.io/uievents/#KeyboardEvent-supplemental-interface |
+ readonly attribute long charCode; |
+ readonly attribute long keyCode; |
+ readonly attribute long which; |
- // FIXME: this does not match the version in the DOM spec. |
- void initKeyboardEvent([Default=Undefined] optional DOMString type, |
- [Default=Undefined] optional boolean canBubble, |
- [Default=Undefined] optional boolean cancelable, |
- [Default=Undefined] optional Window view, |
- [Default=Undefined] optional DOMString keyIdentifier, |
- [Default=Undefined] optional unsigned long location, |
- [Default=Undefined] optional boolean ctrlKey, |
- [Default=Undefined] optional boolean altKey, |
- [Default=Undefined] optional boolean shiftKey, |
- [Default=Undefined] optional boolean metaKey); |
+ // Non-standard APIs |
+ [Measure] readonly attribute DOMString keyIdentifier; |
+ [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation] readonly attribute unsigned long keyLocation; |
}; |
- |