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 { |