Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MediaSource, disallow any more extensions #103

Merged
merged 3 commits into from
Feb 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1621,8 +1621,7 @@ where [=map/keys=] are [=valid URL strings=]
and [=map/values=] are [=blob URL Entries=].

A <dfn export>blob URL entry</dfn> consists of
an <dfn export for="blob URL entry">object</dfn> (typically a {{Blob}},
but other specs can extend this to refer to other types of objects),
an <dfn export for="blob URL entry">object</dfn> (of type {{Blob}} or {{MediaSource}}),
and an <dfn export for="blob URL entry">environment</dfn> (an [=environment settings object=]).

[=map/Keys=] in the [=blob URL store=] (also known as <dfn lt="blob URL|object URL" export>blob URLs</dfn>)
Expand Down Expand Up @@ -1730,14 +1729,14 @@ and presents methods for <a>blob URL</a> creation and revocation.
<pre class="idl">
[Exposed=(Window,DedicatedWorker,SharedWorker)]
partial interface URL {
static DOMString createObjectURL(Blob blob);
static DOMString createObjectURL((Blob or MediaSource) obj);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this valid? MediaSource is not exposed everywhere URL is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't it be "valid" (for whatever definition of valid you're asking about)? You just won't be able to pass in a MediaSource when in a worker, but that doesn't seem that crazy?

I'm not sure how else we'd be writing this in IDL either, since you can't have two overloads of the same method with different Exposed= values for example (perhaps you could somehow work around it with two separate partial interfaces? But if that is a possible way to get different overloads with different Exposed= values, I'm not sure why it isn't just allowed directly).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we had this discussion before (likely different people) and decided it ought to work. See also send() in https://xhr.spec.whatwg.org/#interface-xmlhttprequest.

static void revokeObjectURL(DOMString url);
};
</pre>

<div algorithm="createObjectURL">
The <dfn method for=URL id="dfn-createObjectURL">createObjectURL(|blob|)</dfn> static method must
return the result of [=adding an entry to the blob URL store=] for |blob|.
The <dfn method for=URL id="dfn-createObjectURL">createObjectURL(|obj|)</dfn> static method must
return the result of [=adding an entry to the blob URL store=] for |obj|.
</div>

<div algorithm="revokeObjectURL">
Expand Down