Index: tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate |
diff --git a/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate b/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate |
index 0d5ec436fe1c11a24bcba26f79fe361d400398a2..578b645926b4a946bac8b358549fe6af59202072 100644 |
--- a/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate |
+++ b/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate |
@@ -6,13 +6,20 @@ part of $LIBRARYNAME; |
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { |
- 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 |
Jacob
2017/05/15 17:12:06
Nit: end comments with a period. Here and in the o
|
+ bool ctrlKey: false, |
+ bool altKey: false, |
+ bool shiftKey: false, |
+ bool metaKey: false}) { |
if (view == null) { |
view = window; |
} |
+ location ??= keyLocation ?? 1; |
final e = document._createEvent("KeyboardEvent"); |
e._initKeyboardEvent(type, canBubble, cancelable, view, "", |
location, ctrlKey, altKey, shiftKey, metaKey); |