Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What exception should speechSynthesis.speak() throw for reused SpeechSynthesis? #8

Open
foolip opened this issue Sep 28, 2017 · 3 comments

Comments

@foolip
Copy link
Member

foolip commented Sep 28, 2017

https://w3c.github.io/speech-api/webspeechapi.html#dfn-ttsspeak says "The SpeechSynthesis object takes exclusive ownership of the SpeechSynthesisUtterance object. Passing it as a speak() argument to another SpeechSynthesis object should throw an exception."

It doesn't say what exception to throw. It should.

Spun off from #7 and a TODO in web-platform-tests/wpt#7510

@foolip
Copy link
Member Author

foolip commented Aug 6, 2018

As it stands, this doesn't throw an exception in any browser:
https://wpt.fyi/results/speech-api/SpeechSynthesis-speak-ownership.html

@jdsmith3000 @andrenatal, do you believe this should throw an exception? In Edge and Firefox, is this case handled at all? In Chromium, it looks like there's just no concept of ownership of SpeechSynthesisUtterance objects, if it's possible to pass them to speak() then they'll be added to an internal queue.

@stephenmcgruer
Copy link

Note also from web-platform-tests/wpt#23097, it was pointed out:

The language used is should throw an exception, not MUST throw an exception.

So technically not throwing an exception is spec-compliant, but that also sounds like a spec bug. SHOULD is reserved for cases where there is a good reason to disobey the behavior in specific circumstances (and it is usually best to spell out those circumstances).

There are some other good points in that issue; worth a read.

@marcoscaceres
Copy link
Collaborator

So technically not throwing an exception is spec-compliant, but that also sounds like a spec bug.

Totally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants