-
Notifications
You must be signed in to change notification settings - Fork 164
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
Should nullable optional dictionary argument have a default value? #774
Comments
Why is this dictionary made nullable? (It's not clear to me we should allow that at all.) |
AFAIK somehow an author decided to do that without any real benefit, per my reading. |
Filed w3c/mediasession#231. Perhaps we should look into forbidding this? At least when there's no required members? And even then it seems like a poor pattern, but I vaguely recall it being too late for nested dictionaries... |
I don't think the prose you quote actually requires a default here (it's not a dictionary type or a union type), but agree that the API doesn't make sense as specced. |
This is not valid IDL. This is mentioned in the note under https://heycam.github.io/webidl/#idl-nullable-type and in the following normative text under https://heycam.github.io/webidl/#idl-operations>:
which explicitly excludes "dictionary" from the list, and the following paragraph, which says:
|
Thanks, then we can close this I think as there's already a downstream issue. |
👍 Thanks for the details! |
I should note that the IDL parser in Firefox already catches this problem with the IDL, though our error reporting there could be better. I'll file a bug on that later today when I can log into bugzilla again. @foolip This is another instance of Blink's binding generator not enforcing Web IDL constraints and that causing Google engineers to write invalid spec IDL... I didn't see an existing issue on this, so filed https://bugs.chromium.org/p/chromium/issues/detail?id=997708 |
Note that I found this when I run my webidl2.js validator (which currently incorrectly suggests adding a default value for an invalid nullable dictionary argument) against WPT, maybe we can still catch this type of problems there. |
Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1577016 on the Gecko side. |
The Media Session spec has the following IDL:
Currently the prose says:
Per my understanding the spec requires a default value for optional nullable dictionaries, but is it intended?
The text was updated successfully, but these errors were encountered: