- From: Jeremy Orlow <jorlow@chromium.org>
- Date: Thu, 29 Apr 2010 18:20:15 +0100
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: Web Applications Working Group WG <public-webapps@w3.org>
- Message-ID: <m2x5dd9e5c51004291020s188f1726t32921c06368a5d7b@mail.gmail.com>
On Thu, Apr 29, 2010 at 6:01 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/29/10 12:13 PM, Jeremy Orlow wrote:
>
>> The following script does not work for me in 3.6. Would love to know
>> what I'm doing wrong:
>>
>> window.onstorage = function() { alert("HI"); }
>> localStorage.foo = localStorage.foo + " ";
>>
>
> In Gecko storage events for a change in window X are fired at all windows
> _except_ X that use that localStorage.
>
> This is in fact what the spec says to do. See
> http://dev.w3.org/html5/webstorage/#localStorageEvent which says:
>
> 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.
>
> (emphasis added).
Ugh. I'm an idiot. I implemented this change in WebKit and even brought it
up on list. :-) Thanks for pointing it out.
> I don't get anything on the error console or any alert. (Though it
>> works in Safari and Opera.)
>>
>
> Sounds like some bugs need to be filed on Safari and Opera.
>
It's already changed in WebKit, so I suspect the next version of Safari will
be fixed. Similarly, the next stable version of Chrome (which is about to
go to beta) does this. And I just filed a bug against opera.
Anyway, I already have a patch out to change from uri -> url. Sounds like
it's the right thing to do: https://bugs.webkit.org/show_bug.cgi?id=38331
J
Received on Thursday, 29 April 2010 17:21:04 UTC