You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the type of an argument is a dictionary type or a union type that has a dictionary type as one of its flattened member types, and that dictionary type and its ancestors have no required members, and the argument is either the final argument or is followed only by optional arguments, then the argument must be specified as optional. Such arguments are always considered to have a default value of an empty dictionary, unless otherwise specified.
Note
This is to encourage API designs that do not require authors to pass an empty dictionary value when they wish only to use the dictionary’s default values.
Dictionary types cannot have a default value specified explicitly, so the “unless otherwise specified” clause above can only be invoked for a union type that has a dictionary type as one of its flattened member types.
So either we have to change DOM to make it optional (even though the method will throw TypeError if it's omitted), or we have to change WebIDL. whatwg/webidl#130 discusses the latter option, and was closed. I'll comment there, although it seems I can't reopen it.
It looks like Edge and Chrome follow the spec and make it mandatory, while Firefox ignores the spec and makes it optional. (Indeed, Firefox's WebIDL parser will reject invalid IDLs like this at compile time.)
The text was updated successfully, but these errors were encountered:
The spec says:
But WebIDL says:
So either we have to change DOM to make it optional (even though the method will throw TypeError if it's omitted), or we have to change WebIDL. whatwg/webidl#130 discusses the latter option, and was closed. I'll comment there, although it seems I can't reopen it.
It looks like Edge and Chrome follow the spec and make it mandatory, while Firefox ignores the spec and makes it optional. (Indeed, Firefox's WebIDL parser will reject invalid IDLs like this at compile time.)
The text was updated successfully, but these errors were encountered: