W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2010

Re: [WebIDL] NoInterfaceObject and access to constants

From: Simon Pieters <simonp@opera.com>
Date: Wed, 16 Jun 2010 00:11:23 +0200
To: "Webapps WG" <public-webapps@w3.org>, "Nikunj Mehta" <nikunj@o-micron.com>
Cc: "Jeremy Orlow" <jorlow@chromium.org>
Message-ID: <op.vec3w9tiidj3kv@simon-pieterss-macbook.local>
On Tue, 15 Jun 2010 16:56:31 +0200, Nikunj Mehta <nikunj@o-micron.com>  
wrote:

> Hi all,
>
> I am trying to provide access to constants defined in IndexedDB  
> interfaces. For example:
> interface IDBRequest : EventTarget {
>     void abort ();
>     const unsigned short INITIAL = 0;
>     const unsigned short LOADING = 1;
>     const unsigned short DONE = 2;
>     readonly attribute unsigned short readyState;
>              attribute Function       onsuccess;
>              attribute Function       onerror;
> };
> Given that this interface doesn't contain the modifier  
> [NoInterfaceObject], shouldn't it be possible to access the global  
> object, e.g., window and from that the interface and from that the  
> constant? As an example:
>
> window.IDBRequest.INITIAL or IDBRequest.INITIAL

Yes.

http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces
http://dev.w3.org/2006/webapi/WebIDL/#es-constants


> For interfaces that should not be available as a property on the global  
> object, I need to apply the [NoInterfaceObject] modifier, but that  
> doesn't apply here.
>
> Can anyone confirm or refute this so that an open issue on the IndexedDB  
> spec can be closed without action?

-- 
Simon Pieters
Opera Software
Received on Tuesday, 15 June 2010 22:12:03 GMT

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