W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] StorageEvent deficiency

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 24 Dec 2008 11:56:28 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0812241156010.24109@hixie.dreamhostps.com>
On Tue, 20 May 2008, Brady Eidson wrote:
>
> The StorageEvent has almost all the information in it that a script 
> would need, except one.
> 
> Imagine a multi-frame page where each document is from the same security 
> origin.  In this case, if one document on the page changes either a 
> SessionStorage item or a LocalStorage item, the other documents on the 
> page have no way of knowing if the StorageEvent generated is from 
> changing SessionStorage or LocalStorage.
> 
> One might argue they could compare the changed key/value in the event to 
> their SessionStorage and LocalStorage and infer which one generated the 
> event, but this is not fool proof.  There are a number of situations 
> that could arise where a script couldn't infer which Storage object had 
> changed.
> 
> I propose adding an additional property to the StorageEvent interface:
> 
> interface StorageEvent : Event {
> 	...
> 	readonly attribute Storage storageArea;
> 	...
> }
> 
> The name of the attribute is up in the air, but the point is that the 
> object would be either the SessionStorage object or the LocalStorage 
> object.

I've tried doing this, though the definition is a bit iffy. Let me know 
if I screwed it up too badly...

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 24 December 2008 03:56:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC