whatwg / webidl

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

Consider disallowing multiple `[LegacyFactoryFunction]` identifiers per interface #878

Open ExE-Boss opened 4 years ago

ExE-Boss commented 4 years ago

Currently, the following is allowed:

[LegacyFactoryFunction=A(),
 LegacyFactoryFunction=B(optional DOMString src),
 LegacyFactoryFunction=C(optional long width, optional long height)]
interface MultipleLegacyFactoryFunctionInterface {};

But it’s not used anywhere, and Chromium’s WebIDL processor doesn’t support it, and WebIDL2JS doesn’t intend to support it either (https://github.com/jsdom/webidl2js/pull/213#issuecomment-621277733).


This doesn’t intend to deprecate overloaded [LegacyFactoryFunction]s, which share the same identifier:

[LegacyFactoryFunction=Overloaded(),
 LegacyFactoryFunction=Overloaded(optional DOMString src),
 LegacyFactoryFunction=Overloaded(optional long width, optional long height)]
interface OverloadedLegacyFactoryFunctionInterface {};

See also

annevk commented 4 years ago

Do we need overloaded though? HTML doesn't use it.

domenic commented 4 years ago

Right, I think we should pare down LegacyFactoryFunction to the minimum, probably.

TimothyGu commented 4 years ago

Neither Blink nor Gecko allows multiple NamedConstructors either.

domenic commented 3 years ago

We should in fact deprecate overloaded [LegacyFactoryFunction]s since nothing uses them and nothing will do so.