whatwg / webidl

Web IDL Standard
https://webidl.spec.whatwg.org/
Other
405 stars 162 forks source link

[Exposed] check for overloaded operations makes no sense #689

Open Ms2ger opened 5 years ago

Ms2ger commented 5 years ago

If [Exposed] appears on an overloaded operation, then it must appear identically on all overloads.

This can be worked around easily with two partial interfaces. Perhaps the check should be based on the exposure sets.

Note that createObjectURL used to have two overloads with different exposure; now it accepts MediaSource in workers even though it isn't exposed there.

bzbarsky commented 5 years ago

This can be worked around easily with two partial interfaces.

How so? https://heycam.github.io/webidl/#idl-overloading says:

Operations must not be overloaded across interface, partial interface, interface mixin, and partial interface mixin definitions.

bzbarsky commented 5 years ago

Now that said, I don't know whether browsers actually implement that last requirement in their IDL processing. I know Gecko does not.

What Gecko does implement is that it requires the set of extended attributes on all overloads of a method to be the same.