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

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

Issue 12025027: Cleaning up event constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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_MouseEvent.darttemplate
diff --git a/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate b/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate
index d7e51a7010c13975bcef53cbb3c54f310d273676..ed29b0f3f156c664dde0373a1a03d00d770a65f3 100644
--- a/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate
@@ -5,16 +5,21 @@
part of html;
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
- factory $CLASSNAME(String type, Window view, int detail, int screenX,
- int screenY, int clientX, int clientY, int button, [bool canBubble = true,
- bool cancelable = true, bool ctrlKey = false, bool altKey = false,
- bool shiftKey = false, bool metaKey = false,
- EventTarget relatedTarget = null]) =>
- _$(CLASSNAME)FactoryProvider.create$CLASSNAME(
- type, view, detail, screenX, screenY,
- clientX, clientY, button, canBubble, cancelable,
- ctrlKey, altKey, shiftKey, metaKey,
- relatedTarget);
+ factory $CLASSNAME(String type,
+ {Window view, int detail: 0, int screenX: 0, int screenY: 0,
+ int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
+ bool cancelable: true, bool ctrlKey: false, bool altKey: false,
+ bool shiftKey: false, bool metaKey: false, EventTarget relatedTarget}) {
+
+ if (view == null) {
+ view = window;
+ }
+ var event = document.$dom_createEvent('MouseEvent');
+ event.$dom_initMouseEvent(type, canBubble, cancelable, view, detail,
+ screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey,
+ button, relatedTarget);
+ return event;
+ }
$!MEMBERS
int get offsetX {

Powered by Google App Engine
This is Rietveld 408576698