Bug 40734 - Storage event not called
Summary: Storage event not called
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P1 Critical
Assignee: Nobody
URL: http://www.jensarps.de/tests/storage....
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-16 13:49 PDT by Ken Andries
Modified: 2011-02-16 11:13 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Andries 2010-06-16 13:49:37 PDT
When I was working on application that uses the addEventListener('storage', handlerFunc, false) I came upon a problem that the handler doesn't do anything.
After some searching I found out it was not my application but a bug thats why I'm filling this one


Test Case
open the url click the button nothing will happen

What should happen
The console should display:
 event handler added
 setItem
 
 storage event launched conaiting value: 
 new value
 old value etc
Comment 1 Kim Grönholm 2010-09-22 03:06:07 PDT
I have also been testing the storage event and I can't get it to trigger with this test case or almost any other I've tried. Only ones that work are the Layout tests that set the event listener via iframe.contentWindow.onstorage. That way I was able to catch the storage event but getting the storage event normally to window.onstorage definitely seems to have a bug.
Comment 2 Jeremy Orlow 2010-09-24 03:26:18 PDT
This is how it's specced.  Please see http://dev.w3.org/html5/webstorage/

"When the setItem(), removeItem(), and clear() methods are called on a Storage object x that is associated with a session storage area, if the methods did something, then in every HTMLDocument object whose Window object's sessionStorage attribute's Storage object is associated with the same storage area, other than x, a storage event must be fired, as described below."

and

"When the setItem(), removeItem(), and clear() methods are called on a Storage object x that is associated with a local storage area, if the methods did something, then in every HTMLDocument object whose Window object's localStorage attribute's Storage object is associated with the same storage area, other than x, a storage event must be fired, as described below."

This question has come up a few times, so I'm not convinced it's the right course of action though.  Maybe you should bring this up on WhatWG?  If so, please cc me?