Closed Bug 1150315 Opened 9 years ago Closed 9 years ago

Successively calling speechSynthesis speak() and cancel() brings queue into bad state

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: eeejay, Assigned: eeejay)

Details

Attachments

(1 file)

The first call to speak() puts one utterance in the queue and calls AdvanceQueue(). AdvanceQueue() in turn peeks at the first utterance in the queue (it only gets popped when the utterance ends), and assigns mCurrentTask with a new task with that utterance.

After calling cancel() the speech task cancels the utterance and waits for an end-of-stream before doing anything further. In the meantime speak() is called again, and mCurrentTask is reassigned.

When the end-of-stream arrives, and OnEnd() is called and the task argument does not match the current task member since it was swapped out by speak().
Attachment #8587132 - Flags: review?(bugs)
This happens (and the test fails) when the speech synthesis is in an OOP child window. When it is all in one process, it happens synchronously, so the state doesn't get messed up.
Attachment #8587132 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/e96b90efdeec
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: