mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:42:11 +00:00
[dart:html] Add webkitSpeechRecognition to SpeechRecognition class
In Safari, the prototype of a SpeechRecognition object returns a webkitSpeechRecognition prototype. This name is different than the one in the @Native annotation, so dart2js fails to recognize it. We should it to the annotation so we properly intercept it. CoreLibraryReviewExempt: Changing bindings of dart:html, no change to API. Change-Id: Ic533e1208dd28e521403998e43009e0f651e2dfa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291961 Reviewed-by: Nate Biggs <natebiggs@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com>
This commit is contained in:
parent
d259edfa28
commit
8ebed3d806
|
@ -28544,7 +28544,7 @@ class SpeechGrammarList extends JavaScriptObject
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
@SupportedBrowser(SupportedBrowser.CHROME, '25')
|
||||
@Native("SpeechRecognition")
|
||||
@Native("SpeechRecognition,webkitSpeechRecognition")
|
||||
class SpeechRecognition extends EventTarget {
|
||||
// To suppress missing implicit constructor warnings.
|
||||
factory SpeechRecognition._() {
|
||||
|
|
|
@ -342,6 +342,8 @@ _dart2js_dom_custom_native_specs = monitored.Dict(
|
|||
'RTCDataChannel,DataChannel',
|
||||
'ScriptProcessorNode':
|
||||
'ScriptProcessorNode,JavaScriptAudioNode',
|
||||
'SpeechRecognition':
|
||||
'SpeechRecognition,webkitSpeechRecognition',
|
||||
'TransitionEvent':
|
||||
'TransitionEvent,WebKitTransitionEvent',
|
||||
'CSSKeyframeRule':
|
||||
|
|
|
@ -5062,6 +5062,17 @@ final Map<String, Map<String, Set<String>>> nativeTypeToDartMembers = {
|
|||
'removeStream': {'removeStream'},
|
||||
'removeTrack': {'removeTrack'},
|
||||
'signalingState': {'signalingState'}
|
||||
},
|
||||
'webkitSpeechRecognition': {
|
||||
'abort': {'abort'},
|
||||
'audioTrack': {'audioTrack'},
|
||||
'continuous': {'continuous'},
|
||||
'grammars': {'grammars'},
|
||||
'interimResults': {'interimResults'},
|
||||
'lang': {'lang'},
|
||||
'maxAlternatives': {'maxAlternatives'},
|
||||
'start': {'start'},
|
||||
'stop': {'stop'}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -9755,7 +9766,7 @@ final Map<String, Set<String>> dartTypeToNativeTypes = {
|
|||
'SpanElement': {'HTMLSpanElement'},
|
||||
'SpeechGrammar': {'SpeechGrammar'},
|
||||
'SpeechGrammarList': {'SpeechGrammarList'},
|
||||
'SpeechRecognition': {'SpeechRecognition'},
|
||||
'SpeechRecognition': {'SpeechRecognition', 'webkitSpeechRecognition'},
|
||||
'SpeechRecognitionAlternative': {'SpeechRecognitionAlternative'},
|
||||
'SpeechRecognitionError': {'SpeechRecognitionError'},
|
||||
'SpeechRecognitionEvent': {'SpeechRecognitionEvent'},
|
||||
|
|
Loading…
Reference in a new issue