Bug 1167541 - Implemented SpeechSynthesisEvent::utterance. r=smaug

This commit is contained in:
Kelly Davis 2015-07-01 04:14:00 -04:00
parent 77466aa90b
commit 2ae535a40a
3 changed files with 4 additions and 0 deletions

View File

@ -436,6 +436,7 @@ const kEventConstructors = {
},
},
SpeechSynthesisEvent: { create: function (aName, aProps) {
aProps.utterance = new SpeechSynthesisUtterance("Hello World");
return new SpeechSynthesisEvent(aName, aProps);
},
},

View File

@ -162,6 +162,7 @@ SpeechSynthesisUtterance::DispatchSpeechSynthesisEvent(const nsAString& aEventTy
SpeechSynthesisEventInit init;
init.mBubbles = false;
init.mCancelable = false;
init.mUtterance = this;
init.mCharIndex = aCharIndex;
init.mElapsedTime = aElapsedTime;
init.mName = aName;

View File

@ -14,6 +14,7 @@
Pref="media.webspeech.synth.enabled"]
interface SpeechSynthesisEvent : Event
{
readonly attribute SpeechSynthesisUtterance utterance;
readonly attribute unsigned long charIndex;
readonly attribute float elapsedTime;
readonly attribute DOMString? name;
@ -21,6 +22,7 @@ interface SpeechSynthesisEvent : Event
dictionary SpeechSynthesisEventInit : EventInit
{
required SpeechSynthesisUtterance utterance;
unsigned long charIndex = 0;
float elapsedTime = 0;
DOMString name = "";