W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: Discussion of File API at TPAC in Lyon

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 15 Nov 2010 16:35:05 -0800
Message-ID: <AANLkTikpzAaHrbXQ=9MT0JF18LiWA2qPCFiZotCwJqof@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>, Anne van Kesteren <annevk@opera.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Adrian Bateman <adrianba@microsoft.com>, Arun Ranganathan <aranganathan@mozilla.com>, Web Applications Working Group WG <public-webapps@w3.org>, Adam Barth <w3c@adambarth.com>
On Sun, Nov 14, 2010 at 8:32 AM, Cameron McCormack <cam@mcc.id.au> wrote:
> Jonas Sicking:
>> Since I wrote the IDL for indexeddb above, WebIDL has gotten support
>> for "static" which should do what we want. Though it's a bit unclear
>> if using a real interface would cause there to be a .prototype
>> property on the URL interface which we for now don't want, right. It's
>> also unclear if static functions appear on URL objects as well.
>
> The new static keyword will cause the function property to exist on the
> interface object and not on the prototype. †Thus you canít access the
> function directly by getting a property on an instance of the interface.

Ok, here is what I'll propose as the final solution:

FileAPI will define the following WebIDL:

[Supplemental]
interface URL {
  static DOMString createObjectURL(in Blob blob);
  static void revokeObjectURL(in DOMString url);
};

It will also contain the following normative text:

ECMAScript implementations of this specification MUST ensure that they
do not expose a <code>prototype</code> property on the URL interface
object unless the implementation also implements the [URL]
specification. In other words, the following expression
<code>URL.prototype</code> MUST evaluate to true if the implementation
implements the [URL] specification, and MUST NOT evaluate to true
otherwise.

I'll also talk with Adam Barth and encourage the following text in the
URL specification:

Users of this API are encouraged to feature test by checking <code>if
(URL && URL.prototype) { ...</code>. Otherwise there is a risk that
implementations which implement the [File API] specification, but not
this specification, will pass the feature test.


Unless I hear otherwise from people, I'll assume that everyone is
happy with this.

/ Jonas
Received on Tuesday, 16 November 2010 00:35:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:42 GMT