зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1167542 - Implement SpeechSynthesisErrorEvent. r=smaug
--HG-- extra : rebase_source : 4dde80daffeffbfd2d9d412733dbee0855d19011
This commit is contained in:
Родитель
d72e70b196
Коммит
1c10aa27ac
|
@ -435,6 +435,12 @@ const kEventConstructors = {
|
|||
return new SpeechRecognitionEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
SpeechSynthesisErrorEvent: { create: function (aName, aProps) {
|
||||
aProps.error = "synthesis-unavailable";
|
||||
aProps.utterance = new SpeechSynthesisUtterance("Hello World");
|
||||
return new SpeechSynthesisErrorEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
SpeechSynthesisEvent: { create: function (aName, aProps) {
|
||||
aProps.utterance = new SpeechSynthesisUtterance("Hello World");
|
||||
return new SpeechSynthesisEvent(aName, aProps);
|
||||
|
|
|
@ -27,6 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=525444
|
|||
|
||||
ok(SpeechSynthesis, "SpeechSynthesis exists in global scope");
|
||||
ok(SpeechSynthesisVoice, "SpeechSynthesisVoice exists in global scope");
|
||||
ok(SpeechSynthesisErrorEvent, "SpeechSynthesisErrorEvent exists in global scope");
|
||||
ok(SpeechSynthesisEvent, "SpeechSynthesisEvent exists in global scope");
|
||||
|
||||
// SpeechSynthesisUtterance is the only type that has a constructor
|
||||
|
|
|
@ -964,6 +964,8 @@ var interfaceNamesInGlobalScope =
|
|||
{name: "SourceBuffer", linux: false, release: false},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "SourceBufferList", linux: false, release: false},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "SpeechSynthesisErrorEvent", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "SpeechSynthesisEvent", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
enum SpeechSynthesisErrorCode {
|
||||
"canceled",
|
||||
"interrupted",
|
||||
"audio-busy",
|
||||
"audio-hardware",
|
||||
"network",
|
||||
"synthesis-unavailable",
|
||||
"synthesis-failed",
|
||||
"language-unavailable",
|
||||
"voice-unavailable",
|
||||
"text-too-long",
|
||||
"invalid-argument",
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional SpeechSynthesisErrorEventInit eventInitDict),
|
||||
Pref="media.webspeech.synth.enabled"]
|
||||
interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent {
|
||||
readonly attribute SpeechSynthesisErrorCode error;
|
||||
};
|
||||
|
||||
dictionary SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit
|
||||
{
|
||||
required SpeechSynthesisErrorCode error;
|
||||
};
|
|
@ -611,6 +611,7 @@ if CONFIG['MOZ_WEBSPEECH']:
|
|||
'SpeechRecognitionResult.webidl',
|
||||
'SpeechRecognitionResultList.webidl',
|
||||
'SpeechSynthesis.webidl',
|
||||
'SpeechSynthesisErrorEvent.webidl',
|
||||
'SpeechSynthesisEvent.webidl',
|
||||
'SpeechSynthesisUtterance.webidl',
|
||||
'SpeechSynthesisVoice.webidl',
|
||||
|
@ -788,6 +789,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
|
|||
if CONFIG['MOZ_WEBSPEECH']:
|
||||
GENERATED_EVENTS_WEBIDL_FILES += [
|
||||
'SpeechRecognitionEvent.webidl',
|
||||
'SpeechSynthesisErrorEvent.webidl',
|
||||
'SpeechSynthesisEvent.webidl',
|
||||
]
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче