[Bug 23946] Lift the ban on query parts in “blob:” URIs

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23946

--- Comment #16 from Arun <arun@mozilla.com> ---
(In reply to Anne from comment #12)
> Arun, I don't think it makes sense to forbid the query component. I would
> also define createObjectURL() more clearly in the specification as emitting
> a serialization of a URL that has scheme "blob", scheme data {generated
> string}, and no query or fragment (forgot whether they have to be null or
> the empty string for that). If you do that a lot of the other text you
> currently have about blob URLs does not seem to be needed.

OK, I've made the definitions of URL.createObjectURL and URL.createFor explicit
about what they emit. The WHATWG URL specification doesn't specify that
fragment and query have to be null or empty to not be present, so I simply say
"no fragment" etc., in keeping with what the URL spec says -- jump in if wrong
on this count.

It turns out, however, that although URL.createObjectURL and URL.createFor
don't explicitly emit fragments and query components, we DO allow fragment (by
popular demand and by use case):

var blobAnchorRef = URL.createFor(file) + "#applicationData";

where #applicationData could be a named element (e.g. anchor link) within an
HTML file.

By explicitly allowing that, we have to state clearly what happens if a query
is appended.  I've spec'd that it be ignored, which doesn't make it illegal to
have one.  We can start paying attention to query in blob: URLs when we figure
out what to do with them, just like we've specified what a fragment might mean
in a Blob URL.  

(In reply to Jonas Sicking from comment #10)
> That seems like a very bad idea. Treating "?" in a data URL seems surprising
> and a source of subtle bugs. 

Separate bugs should be filed about data URLs.


(In reply to Manuel Strehl from comment #15)

> 
> The remaining question is twofold, a fundamental and a pragmatic part:
> 
> 1. How does a generic URL look like, scheme:any-stuff or
> scheme:hier?query#fragment? It's my understanding so far, that the first is
> the basic definition of an URI, which also allows, e.g., URNs like isbn:,
> while the second is, what URLs look like. 

I defer to http://url.spec.whatwg.org/

>Hence, blob-_URLs_ should handle
> '?' and '#' specially. Of course, if I'm misguided here, that point is
> invalid.


I *think* that we don't have to special case "#".  I think ignoring query for
now isn't quite a special case.


> 
> 2. How do developers use the blob: URLs? E.g., will there be significant use
> cases, what would be the more surprising behaviour, ... With my anecdotal
> evidence drawn from the data: URL / fragment identifier analogy above, I'd
> still argue for treating '?' specially, but I haven't got more profound data
> to back this. Just my guts.


I think the lion's share of use cases will involve short-lived identifiers to
file references.  When use cases emerge that really clamor for query, we can
accommodate them.  Of course, if that happens, I think we should break out
blob: URLs from File and deal with them properly, along with mediastream:.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 5 December 2013 22:28:33 UTC