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

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

Issue 12047020: Adding supported checks to media events (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/scripts/systemhtml.py ('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..b982e0143509e3351d6b3ca471c99145773a1c4e 100644
--- a/tools/dom/templates/html/impl/impl_Event.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Event.darttemplate
@@ -16,4 +16,16 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
factory $CLASSNAME(String type, [bool canBubble = true, bool cancelable = true]) =>
_$(CLASSNAME)FactoryProvider.create$CLASSNAME(type, canBubble, cancelable);
$!MEMBERS
+
+ /**
+ * Checks to see if the event class is supported by the current platform.
+ */
+ static bool _isTypeSupported(String eventType) {
+ // Browsers throw for unsupported event names.
+ try {
+ var e = document.$dom_createEvent(eventType);
+ return e is Event;
+ } catch (_) { }
+ return false;
+ }
}
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698