W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

[Bug 19540] New: Firing WebStorage storage event

From: <bugzilla@jessica.w3.org>
Date: Mon, 15 Oct 2012 12:19:16 +0000
To: public-webapps@w3.org
Message-ID: <bug-19540-2927@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19540

          Priority: P2
            Bug ID: 19540
                CC: ian@hixie.ch, mike@w3.org, public-webapps@w3.org
          Assignee: ian@hixie.ch
           Summary: Firing WebStorage storage event
        QA Contact: public-webapps-bugzilla@w3.org
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: jmajnert@gmail.com
          Hardware: PC
            Status: NEW
           Version: unspecified
         Component: Web Storage (editor: Ian Hickson)
           Product: WebAppsWG

When trying to implement local storage I found it hard to understand the rules
for firing the "storage" event.

In section 11.2.3
(http://www.whatwg.org/specs/web-apps/current-work/multipage/webstorage.html#the-localstorage-attribute)
we have this sentence [1]:
"
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 Document 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.
"


"as described below" points to section 11.2.4, which reads [2]:
"
The storage event is fired when a storage area changes, as described
in the previous two sections (for session storage, for local storage).
When this happens, the user agent must queue a task to fire an event
with the name storage, which does not bubble and is not cancelable,
and which uses the StorageEvent interface, at each Window object whose
Document object has a Storage object that is affected.
"

What I understood:
Sentence [1] says that storage events should be fired on affected
Document objects, except the one that originated the change.
Sentences in [2]  say that when a storage event is fired as described
in [1], a task must be queued to fire storage events on all affected
Window objects. It also says that Document objects have Storage
objects, which I don't think is true.

Is my understanding correct? What am I missing?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Monday, 15 October 2012 12:19:22 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:55 GMT