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

Unified Diff: tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate

Issue 2884713002: Add keyLocation to KeyboardEvent constructor for backwards compatibility (Closed)
Patch Set: Created 3 years, 7 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: 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);

Powered by Google App Engine
This is Rietveld 408576698