spec/Overview.html 1.1747 2576 Don't fire a 'storage' event if the meth

Don't fire a 'storage' event if the methods did nothing. (credit: pt)
(whatwg r2576)

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.
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#localStorageEvent
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.
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#sessionStorageEvent
5.10.1.4 The localStorage attribute
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#the-localstorage-attribute
clear()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#dom-storage-clear
5.10.1.5 The storage event
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#the-storage-event
storage
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#event-storage
removeItem(key)
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#dom-storage-removeitem
5.10.1.3 The sessionStorage attribute
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1747.html#the-sessionstorage-attribute

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1746&r2=1.1747&f=h
http://html5.org/tools/web-apps-tracker?from=2575&to=2576

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1746
retrieving revision 1.1747
diff -u -d -r1.1746 -r1.1747
--- Overview.html 24 Dec 2008 12:29:40 -0000 1.1746
+++ Overview.html 24 Dec 2008 12:34:46 -0000 1.1747
@@ -31425,11 +31425,13 @@
   pair with the given <var title="">key</var> to be removed from the
   list associated with the object, if it exists. If no item with that
   key exists, the method must do nothing.<p>The <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code> and <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code> methods must be
-  atomic with respect to failure. That is, changes to the data storage
-  area must either be successful, or the data storage area must not be
-  changed at all.<p>The <dfn id=dom-storage-clear title=dom-Storage-clear><code>clear()</code></dfn>
+  atomic with respect to failure. In the case of failure, the method
+  does nothing. That is, changes to the data storage area must either
+  be successful, or the data storage area must not be changed at
+  all.<p>The <dfn id=dom-storage-clear title=dom-Storage-clear><code>clear()</code></dfn>
   method must atomically cause the list associated with the object to
-  be emptied of all key/value pairs.<p class=note>When the <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code>, <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code>, and <code title=dom-Storage-clear><a href=#dom-storage-clear>clear()</a></code> methods are invoked, events
+  be emptied of all key/value pairs, if there are any. If there are
+  none, then the method must do nothing.<p class=note>When the <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code>, <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code>, and <code title=dom-Storage-clear><a href=#dom-storage-clear>clear()</a></code> methods are invoked, events
   are fired on other <code><a href=#htmldocument>HTMLDocument</a></code> objects that can access
   the newly stored or removed data, as defined in the sections on the
   <code title=dom-sessionStorage><a href=#dom-sessionstorage>sessionStorage</a></code> and <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attributes.</p><!--
@@ -31472,10 +31474,11 @@
   point on, however, the two session storage areas must be considered
   separate, not affecting each other in any way.<p id=sessionStorageEvent>When the <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code>, <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code>, and <code title=dom-Storage-clear><a href=#dom-storage-clear>clear()</a></code> methods are called on a
   <code><a href=#storage-0>Storage</a></code> object <var title="">x</var> that is associated
-  with a session storage area, then in every <code><a href=#htmldocument>HTMLDocument</a></code>
-  object whose <code><a href=#window>Window</a></code> object's <code title=dom-sessionStorage><a href=#dom-sessionstorage>sessionStorage</a></code> attribute's
-  <code><a href=#storage-0>Storage</a></code> object is associated with the same storage
-  area, other than <var title="">x</var>, a <code title=event-storage><a href=#event-storage>storage</a></code> event must be fired, as <a href=#event-storage title=event-storage>described below</a>.<h5 id=the-localstorage-attribute><span class=secno>5.10.1.4 </span>The <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute</h5><p>The <dfn id=dom-localstorage title=dom-localStorage><code>localStorage</code></dfn>
+  with a session storage area, if the methods did something, then in
+  every <code><a href=#htmldocument>HTMLDocument</a></code> object whose <code><a href=#window>Window</a></code>
+  object's <code title=dom-sessionStorage><a href=#dom-sessionstorage>sessionStorage</a></code>
+  attribute's <code><a href=#storage-0>Storage</a></code> object is associated with the same
+  storage area, other than <var title="">x</var>, a <code title=event-storage><a href=#event-storage>storage</a></code> event must be fired, as <a href=#event-storage title=event-storage>described below</a>.<h5 id=the-localstorage-attribute><span class=secno>5.10.1.4 </span>The <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute</h5><p>The <dfn id=dom-localstorage title=dom-localStorage><code>localStorage</code></dfn>
   object provides a <code><a href=#storage-0>Storage</a></code> object for an
   <a href=#origin-0>origin</a>.<p>User agents must have a set of local storage areas, one for each
   <a href=#origin-0>origin</a>.<p>User agents should expire data from the local storage areas only
@@ -31495,18 +31498,18 @@
   <code>Document</code> object must have a separate object for its
   <code><a href=#window>Window</a></code>'s <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute.<p id=localStorageEvent>When the <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code>, <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code>, and <code title=dom-Storage-clear><a href=#dom-storage-clear>clear()</a></code> methods are called on a
   <code><a href=#storage-0>Storage</a></code> object <var title="">x</var> that is associated
-  with a local storage area, then in every <code><a href=#htmldocument>HTMLDocument</a></code>
-  object whose <code><a href=#window>Window</a></code> object's <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute's
-  <code><a href=#storage-0>Storage</a></code> object is associated with the same storage
-  area, other than <var title="">x</var>, a <code title=event-storage><a href=#event-storage>storage</a></code> event must be fired, as <a href=#event-storage title=event-storage>described below</a>.<h5 id=the-storage-event><span class=secno>5.10.1.5 </span>The <code title=event-storage><a href=#event-storage>storage</a></code> event</h5><!-- XXX fix up for workers: target is wrong, source and storageArea
+  with a local storage area, if the methods did something, then in
+  every <code><a href=#htmldocument>HTMLDocument</a></code> object whose <code><a href=#window>Window</a></code>
+  object's <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code>
+  attribute's <code><a href=#storage-0>Storage</a></code> object is associated with the same
+  storage area, other than <var title="">x</var>, a <code title=event-storage><a href=#event-storage>storage</a></code> event must be fired, as <a href=#event-storage title=event-storage>described below</a>.<h5 id=the-storage-event><span class=secno>5.10.1.5 </span>The <code title=event-storage><a href=#event-storage>storage</a></code> event</h5><!-- XXX fix up for workers: target is wrong, source and storageArea
   definitions are wrong --><p>The <dfn id=event-storage title=event-storage><code>storage</code></dfn> event
   is fired in an <code><a href=#htmldocument>HTMLDocument</a></code> when a storage area
   changes, as described in the previous two sections (<a href=#sessionStorageEvent>for session storage</a>, <a href=#localStorageEvent>for local storage</a>).<p>When this happens, the user agent must dispatch an event with the
   name <code><a href=#storage-0>storage</a></code>, with no namespace, which does not bubble
-  but is cancelable, and which uses the <code><a href=#storageevent>StorageEvent</a></code>, at
-  <a href=#the-body-element-1>the body element</a> of each <a href=#active-document title="active
-  document">active</a> <code><a href=#htmldocument>HTMLDocument</a></code> object
-  affected.<p>If the event is being fired due to an invocation of the
+  but is cancelable, and which uses the <code><a href=#storageevent>StorageEvent</a></code>
+  interface, at <a href=#the-body-element-1>the body element</a> of each <a href=#active-document title="active document">active</a> <code><a href=#htmldocument>HTMLDocument</a></code>
+  object affected.<p>If the event is being fired due to an invocation of the
   <code title=dom-Storage-setItem><a href=#dom-storage-setitem>setItem()</a></code> or <code title=dom-Storage-removeItem><a href=#dom-storage-removeitem>removeItem()</a></code> methods, the
   event must have its <code title=dom-StorageEvent-key><a href=#dom-storageevent-key>key</a></code>
   attribute set to the name of the key in question, its <code title=dom-StorageEvent-oldValue><a href=#dom-storageevent-oldvalue>oldValue</a></code> attribute set to

Received on Wednesday, 24 December 2008 12:38:19 UTC