This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Doesn't really make sense to have optional dictionaries, if the dictionary has required properties. Gecko bug https://bugzilla.mozilla.org/show_bug.cgi?id=1129239
No, it does. It's reasonable to have an argument which is optional altogether, but if you *do* pass a dict, it *must* have certain properties. (In other words, they're either required or optional as a block.)
Except that's not how optional dictionaries behave in the spec at the moment. Optional dictionaries always have the default value null (or Object.create(null) if you prefer to think of it that way; the behavior is identical), so not passing the argument for an optional dictionary is the same thing as passing null or Object.create(null), which is guaranteed to throw if the dictionary has a required member.
I think if we want to ensure that APIs that allow an empty dictionary value to also be specified as undefined (and probably we do), and we also want to allow APIs with arguments with required dictionary members, then allowing the "optional" keyword to be dropped iff the dictionary does have required members makes sense.
https://github.com/heycam/webidl/commit/b1dea262d0d5894d8954fa6478e30bf67fc2950d