Re: Updates to File API

On May 21, 2010, at 00:41 , Jonas Sicking wrote:
> On Thu, May 20, 2010 at 2:53 PM, Nathan <nathan@webr3.org> wrote:
>> If the scope of the identifiers is limited to a single ua, on a single
>> machine, and specific to that single ua (as in I can't expect to request the
>> identifier outside of the ua that provided it on x machine and get the same
>> results) then I (personally) can't see why there's a need for anything more
>> than a simple unique identifier (sha1 or suchlike)
> Note that the important point of these URNs isn't that they are
> identifiers, but rather that you can point a <iframe>.src, or a
> <img>.src, or a #myElement { background-url: url(...) } at them.

Right, and to further Jonas's explanation, imagine .url (or .id, or whatever) returned a simple identifier, say some opaque hex string of sorts like "DEADBEEF". Now you want to get that image file and assign it as the source of an <img> (which is the whole point):

  img.src = file.url;

If your document is at http://deadbff.org/foo/ you've essentially made your image element link to http://deadbff.org/foo/DEADBEEF. That's not what you wanted.

Using a syntax (be it URI scheme or URN) that can naturally disambiguate between relative URI references and these "magic" references is, alas, needed.

-- 
Robin Berjon - http://berjon.com/

Received on Friday, 21 May 2010 09:28:55 UTC