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

WebIDL requires constraints on getUserMedia to be optional #366

Closed
alvestrand opened this issue Jun 14, 2016 · 2 comments
Closed

WebIDL requires constraints on getUserMedia to be optional #366

alvestrand opened this issue Jun 14, 2016 · 2 comments
Assignees

Comments

@alvestrand
Copy link
Contributor

We've encountered this before: A trailing dictionary argument with no required members MUST be optional. The argument to

    <dt>Promise&lt;MediaStream&gt; getUserMedia( MediaStreamConstraints
    constraints)</dt>

isn't.

I'm not happy with this, because we have to make it optional and then add prose saying it's not (omitting it will result in a TypeError, per the procedure already present in the text), but I guess we have to follow the rule.

@bzbarsky
Copy link

You don't need any extra prose here, right? If it's optional, not providing it will produce the same dictionary as providing {} would, and then your existing prose would cause an exception to be thrown, afaict.

@alvestrand
Copy link
Contributor Author

alvestrand commented Jun 16, 2016

The extra prose that could be useful is "the word "optional" occurs in the WebIDL due to WebIDL rules, but the arugment MUST be supplied in order for the call to succeed". This can be put in the text next to "If requestedMediaTypes is the empty set, return a promise rejected with a TypeError." (section 10.2.1, 3rd bullet of getUserMedia).

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

No branches or pull requests

4 participants