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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 12026032: Adding supported checks & test for SpeechRecognition APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changing event type constructor. 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..aa8a36d63d1bbf17588a5024cfabce3ec0676863 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -10700,8 +10700,25 @@ class Event extends NativeFieldWrapperClass1 {
//
// Contrary to JS, we default canBubble and cancelable to true, since that's
// what people want most of the time anyway.
- factory Event(String type, [bool canBubble = true, bool cancelable = true]) =>
- _EventFactoryProvider.createEvent(type, canBubble, cancelable);
+ factory Event(String type,
+ [bool canBubble = true, bool cancelable = true]) {
+ return new Event.type('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 = Event.type('MouseEvent', 'mousedown', true, true);
+ */
+ factory Event.type(String eventType, String type, [bool canBubble = true,
+ bool cancelable = true]) {
+ final Event e = document.$dom_createEvent(eventType);
+ e.$dom_initEvent(type, canBubble, cancelable);
+ return e;
+ }
Event.internal();
static const int AT_TARGET = 2;
@@ -22061,6 +22078,8 @@ class SpeechInputResult extends NativeFieldWrapperClass1 {
@DocsEditable
@DomName('SpeechRecognition')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognition extends EventTarget {
SpeechRecognition.internal() : super.internal();
@@ -22112,6 +22131,9 @@ class SpeechRecognition extends EventTarget {
factory SpeechRecognition() => SpeechRecognition._create();
static SpeechRecognition _create() native "SpeechRecognition_constructor_Callback";
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => true;
+
@DocsEditable
@DomName('EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent')
SpeechRecognitionEvents get on =>
@@ -22274,6 +22296,8 @@ class SpeechRecognitionEvents extends Events {
@DocsEditable
@DomName('SpeechRecognitionAlternative')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionAlternative extends NativeFieldWrapperClass1 {
SpeechRecognitionAlternative.internal();
@@ -22295,6 +22319,8 @@ class SpeechRecognitionAlternative extends NativeFieldWrapperClass1 {
@DocsEditable
@DomName('SpeechRecognitionError')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionError extends Event {
SpeechRecognitionError.internal() : super.internal();
@@ -22316,6 +22342,8 @@ class SpeechRecognitionError extends Event {
@DocsEditable
@DomName('SpeechRecognitionEvent')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionEvent extends Event {
SpeechRecognitionEvent.internal() : super.internal();
@@ -22345,6 +22373,8 @@ class SpeechRecognitionEvent extends Event {
@DocsEditable
@DomName('SpeechRecognitionResult')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionResult extends NativeFieldWrapperClass1 {
SpeechRecognitionResult.internal();
« 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