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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index fff74cc325a7550d88d63b927119794220e4bc14..d01751179e54dc7ea0876b06f2797c482802acc5 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -10812,6 +10812,18 @@ class Event extends NativeFieldWrapperClass1 {
@DomName('Event.stopPropagation')
void stopPropagation() native "Event_stopPropagation_Callback";
+
+ /**
+ * 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;
+ }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -17187,6 +17199,9 @@ class MediaStreamEvents extends Events {
class MediaStreamEvent extends Event {
MediaStreamEvent.internal() : super.internal();
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => true;
+
@DocsEditable
@DomName('MediaStreamEvent.stream')
MediaStream get stream native "MediaStreamEvent_stream_Getter";
@@ -17303,6 +17318,9 @@ class MediaStreamTrackEvents extends Events {
class MediaStreamTrackEvent extends Event {
MediaStreamTrackEvent.internal() : super.internal();
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => true;
+
@DocsEditable
@DomName('MediaStreamTrackEvent.track')
MediaStreamTrack get track native "MediaStreamTrackEvent_track_Getter";
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698