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

Re: WebStorage and WebDatabase - creation and exceptions

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 26 Nov 2009 01:37:46 +0000 (UTC)
To: "Nikunj R. Mehta" <nikunj.mehta@oracle.com>, Jonas Sicking <jonas@sicking.cc>
Cc: Web Applications Working Group WG <public-webapps@w3.org>
Message-ID: <Pine.LNX.4.62.0911260129300.10133@hixie.dreamhostps.com>
On Mon, 31 Aug 2009, Nikunj R. Mehta wrote:
>
> In WebDatabase:
> 
> The user agent may raise a SECURITY_ERR exception instead of returning a 
> Database object if the request violates a policy decision (e.g. if the 
> user agent is configured to not allow the page to open databases).
> 
> In WebStorage (emphasis mine):
> 
> When a new HTMLDocument is created, the user agent must check to see if 
> the document's top-level browsing context has allocated a session 
> storage area for that document's origin. If it has not, a new storage 
> area for that document's origin must be created.
> 
> When the localStorage attribute is accessed, the user agent must check 
> to see if it has allocated a local storage area for the origin of the 
> Document of the Window object on which the method was invoked. If it has 
> not, a new storage area for that origin must be created.
> 
> A browser may not allow local storage for a certain origin, just like it 
> may not allow cookies to be stored. What is the expected behavior in 
> that case?
> 
> Alternatively, why allow browsers to selectively block out WebDatabase 
> and not other kinds of storage?

On Mon, 21 Sep 2009, Jonas Sicking wrote:
>
> The inconsistency seems like an oversight to me.
> 
> Though I'm not sure what the correct way to do this is. It seems silly 
> to for *every* feature mention that the UA may do something different if 
> the user has opted to disable a feature for whatever reason. If I as an 
> implementor wanted to allow my users to disable addEventListener, I 
> would do so even if the spec doesn't explicitly allow it.
> 
> On the other hand, it might be somewhat useful to give implementors a 
> hint on *how* to disable a feature if it decides to do so. For example 
> for addEventListener it might be appropriate to simply do nothing rather 
> than throw an exception.

I've added the hint to the localStorage spec for consistency.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 26 November 2009 01:38:22 GMT

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