Bug 40734
| Summary: | Storage event not called | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ken Andries <ken.andries.1992> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Critical | CC: | cmarcelo, jorlow, kim.1.gronholm |
| Priority: | P1 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac | ||
| OS: | OS X 10.6 | ||
| URL: | http://www.jensarps.de/tests/storage.html | ||
Ken Andries
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
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Kim Grönholm
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.
Jeremy Orlow
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?