Bug 191745
Summary: | Web Speech API: `speechSynthesis.clear()` removes utterances from following `speechSynthesis.speak(...)` as well | ||
---|---|---|---|
Product: | WebKit | Reporter: | Giovanni Piller Cottrer <giovanni.piller> |
Component: | Accessibility | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | cfleizach, n_wang, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 12 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Giovanni Piller Cottrer
`speechSynthesis.clear()` removes following `speechSynthesis.speak(....)` instances as well.
JSFiddle: https://jsfiddle.net/4perg5cs/1/
Code for reproduction:
```
var synth = window.speechSynthesis;
var utterance1 = new SpeechSynthesisUtterance('How about we say this now? This is quite a long sentence to say.');
var utterance2 = new SpeechSynthesisUtterance('We should say another sentence too, just to be on the safe side.');
var utterance3 = new SpeechSynthesisUtterance('WebKit only speaks this.');
synth.speak(utterance1);
synth.cancel();
synth.speak(utterance2);
synth.speak(utterance3);
// actual result: only utterance3 is spoken
// expected result: utterance2 is spoken, then utterance3 is spoken
```
Note: adding multiple `speechSynthesis.speak(....)` before utterance3 won't change the actual result.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Giovanni Piller Cottrer
As reference, this doesn't happen on:
- Chrome 70.0.3538.102
- Firefox 63.0.1
Radar WebKit Bug Importer
<rdar://problem/46151521>
chris fleizach
(In reply to Giovanni Piller Cottrer from comment #1)
> As reference, this doesn't happen on:
> - Chrome 70.0.3538.102
> - Firefox 63.0.1
yea seems like we're not honoring this
" If it is not paused and no other utterances are in the queue, then this utterance is spoken immediately, else this utterance is queued to begin speaking after the other utterances in the queue have been spoken"
https://w3c.github.io/speech-api/speechapi.html#tts-attributes
chris fleizach
(In reply to chris fleizach from comment #3)
> (In reply to Giovanni Piller Cottrer from comment #1)
> > As reference, this doesn't happen on:
> > - Chrome 70.0.3538.102
> > - Firefox 63.0.1
>
> yea seems like we're not honoring this
>
> " If it is not paused and no other utterances are in the queue, then this
> utterance is spoken immediately, else this utterance is queued to begin
> speaking after the other utterances in the queue have been spoken"
>
> https://w3c.github.io/speech-api/speechapi.html#tts-attributes
NSSpeechSynthesizer doesn't do any queuing by default, so we're getting bit by that
chris fleizach
(In reply to chris fleizach from comment #4)
> (In reply to chris fleizach from comment #3)
> > (In reply to Giovanni Piller Cottrer from comment #1)
> > > As reference, this doesn't happen on:
> > > - Chrome 70.0.3538.102
> > > - Firefox 63.0.1
> >
> > yea seems like we're not honoring this
> >
> > " If it is not paused and no other utterances are in the queue, then this
> > utterance is spoken immediately, else this utterance is queued to begin
> > speaking after the other utterances in the queue have been spoken"
> >
> > https://w3c.github.io/speech-api/speechapi.html#tts-attributes
>
> NSSpeechSynthesizer doesn't do any queuing by default, so we're getting bit
> by that
hmm, but SpeechSynthesis looks like it should be handling queueing