Index: tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
diff --git a/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate b/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
index 408c641ac195d45c93041ea51d4df7389da3ce9f..d66a2cf57934dc7b743a48ee1ac3dc07306a5e2f 100644 |
--- a/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
+++ b/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
@@ -24,13 +24,20 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS |
* creating keyboard events with specific key value contents, see the custom |
* Event [KeyEvent]. |
*/ |
- factory $CLASSNAME(String type, |
- {Window view, bool canBubble: true, bool cancelable: true, |
- int location: 1, bool ctrlKey: false, |
- bool altKey: false, bool shiftKey: false, bool metaKey: false}) { |
+ factory $CLASSNAME(String type, { |
+ Window view, |
+ bool canBubble: true, |
+ bool cancelable: true, |
+ int location, |
+ int keyLocation, // Legacy alias for location |
+ bool ctrlKey: false, |
+ bool altKey: false, |
+ bool shiftKey: false, |
+ bool metaKey: false}) { |
if (view == null) { |
view = window; |
} |
+ location ??= keyLocation ?? 1; |
KeyboardEvent e = document._createEvent("KeyboardEvent"); |
e._initKeyboardEvent(type, canBubble, cancelable, view, "", |
location, ctrlKey, altKey, shiftKey, metaKey); |