Closed
Bug 1236060
Opened 8 years ago
Closed 8 years ago
Utterance errors don't advance queue
Categories
(Core :: Web Speech, defect)
Core
Web Speech
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: eeejay, Assigned: eeejay)
Details
Attachments
(1 file)
9.05 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
If an utterance ends with an error, the window and global queue don't advance.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8703170 -
Flags: review?(bugs)
Comment 2•8 years ago
|
||
Comment on attachment 8703170 [details] [diff] [review] Dispatch error should advance queue. > nsSpeechTask::DispatchError(float aElapsedTime, uint32_t aCharIndex) > { >+ LOG(LogLevel::Debug, ("nsSpeechTask::DispatchError")); >+ > if (!mIndirectAudio) { > NS_WARNING("Can't call DispatchError() from a direct audio speech service"); > return NS_ERROR_FAILURE; > } > >+ if (!mPreCanceled) { >+ nsSynthVoiceRegistry::GetInstance()->SpeakNext(); >+ } >+ > return DispatchErrorImpl(aElapsedTime, aCharIndex); > } > > nsresult > nsSpeechTask::DispatchErrorImpl(float aElapsedTime, uint32_t aCharIndex) > { > MOZ_ASSERT(mUtterance); > if(NS_WARN_IF(mUtterance->mState == SpeechSynthesisUtterance::STATE_ENDED)) { > return NS_ERROR_NOT_AVAILABLE; > } > >+ if (mSpeechSynthesis) { >+ mSpeechSynthesis->OnEnd(this); >+ } >+ > mUtterance->mState = SpeechSynthesisUtterance::STATE_ENDED; > mUtterance->DispatchSpeechSynthesisEvent(NS_LITERAL_STRING("error"), > aCharIndex, aElapsedTime, > EmptyString()); This looks a bit odd. We call SpeakNext before dispatching error event. I'd expect error event handler to be able to cancel proceeding altogether. Also calling SpeakNext() before calling OnEnd(), is that really what happens in non-error cases? Could you explain or fix, and ask review again.
Attachment #8703170 -
Flags: review?(bugs)
Comment 3•8 years ago
|
||
Comment on attachment 8703170 [details] [diff] [review] Dispatch error should advance queue. oh, actually, perhaps we want this behavior so that error listener can cancel the already scheduled thing.
Attachment #8703170 -
Flags: review+
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → eitan
Comment 5•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/67ea3d1ffcdb
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•