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

Unified Diff: tools/dom/templates/html/impl/impl_Event.darttemplate

Issue 12045033: Adding supported checks & test for SpeechRecognition APIs. (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
« no previous file with comments | « tools/dom/templates/html/dart2js/impl_SpeechRecognition.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Event.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Event.darttemplate b/tools/dom/templates/html/impl/impl_Event.darttemplate
index 9fddd1c56b5a5d99b7f5bc8c4f02cb4f6178b5d8..0ca534a19839ddc03ca8991508685be7ba827d9e 100644
--- a/tools/dom/templates/html/impl/impl_Event.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Event.darttemplate
@@ -13,7 +13,24 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
//
// Contrary to JS, we default canBubble and cancelable to true, since that's
// what people want most of the time anyway.
- factory $CLASSNAME(String type, [bool canBubble = true, bool cancelable = true]) =>
- _$(CLASSNAME)FactoryProvider.create$CLASSNAME(type, canBubble, cancelable);
+ factory $CLASSNAME(String type,
+ [bool canBubble = true, bool cancelable = true]) {
+ return new Event.eventType('Event', type, canBubble, cancelable);
+ }
+
+ /**
+ * Creates a new Event object of the specified type.
+ *
+ * This is analogous to document.createEvent.
+ * Normally events should be created via their constructors, if available.
+ *
+ * var e = new Event.type('MouseEvent', 'mousedown', true, true);
+ */
+ factory Event.eventType(String type, String name, [bool canBubble = true,
+ bool cancelable = true]) {
+ final Event e = document.$dom_createEvent(type);
+ e.$dom_initEvent(name, canBubble, cancelable);
+ return e;
+ }
$!MEMBERS
}
« no previous file with comments | « tools/dom/templates/html/dart2js/impl_SpeechRecognition.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698