w3c / media-source

Media Source Extensions
https://w3c.github.io/media-source/
Other
267 stars 57 forks source link

URL.createObjectURL IDL is wrong (no overload across partial interfaces) #211

Closed saschanaz closed 3 years ago

saschanaz commented 6 years ago

https://heycam.github.io/webidl/#idl-overloading

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

For example, the overloads for both f and g are disallowed:

[Exposed=Window]
interface A {
 void f();
};

partial interface A {
 void f(double x);
 void g();
};

partial interface A {
 void g(DOMString x);
};

Currently the MSE spec is adding an overload for URL.createObjectURL by a partial interface.

[Exposed=Window]
partial interface URL {
    static DOMString createObjectURL(MediaSource mediaSource);
};

We should probably fix this in the File API spec.

wolenetz commented 5 years ago

Further: "If [Exposed] appears on an overloaded operation, then it must appear identically on all overloads." per https://heycam.github.io/webidl/#Exposed (as noted by @bzbarsky https://github.com/w3c/media-source/issues/168#issuecomment-410269436)

saschanaz commented 5 years ago

See also w3c/FileAPI#100 and w3c/FileAPI#103.

wolenetz commented 3 years ago

Follow-up on this in V2 milestone is necessary, since this is the only current way to extend and support MSE REC.

saschanaz commented 3 years ago

w3c/FileAPI#103 did the work, MSE can simply remove it. (https://github.com/w3c/media-source/pull/229)

tidoust commented 3 years ago

There are tests on createObjectURL under wpt/media-source. They should probably be moved to wpt/FileAPI/url afterwards, since they would no longer test normative behavior defined in MSE (at least at first sight).