[whatwg] StorageEvent deficiency

Ian Hickson ian at hixie.ch
Wed Dec 24 03:56:28 PST 2008

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.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list