[html5] r2576 - [giw] (2) Don't fire a 'storage' event if the methods did nothing. (credit: pt)

whatwg at whatwg.org whatwg at whatwg.org
Wed Dec 24 04:34:43 PST 2008


Author: ianh
Date: 2008-12-24 04:34:42 -0800 (Wed, 24 Dec 2008)
New Revision: 2576

Modified:
   index
   source
Log:
[giw] (2) Don't fire a 'storage' event if the methods did nothing. (credit: pt)

Modified: index
===================================================================
--- index	2008-12-24 12:29:35 UTC (rev 2575)
+++ index	2008-12-24 12:34:42 UTC (rev 2576)
@@ -38632,13 +38632,15 @@
   key exists, the method must do nothing.</p>
 
   <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>
+  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>
 
   <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>
+  be emptied of all key/value pairs, if there are any. If there are
+  none, then the method must do nothing.</p>
 
   <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
@@ -38707,10 +38709,11 @@
 
   <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>.</p>
+  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>.</p>
 
 
   <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>
@@ -38745,10 +38748,11 @@
 
   <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>.</p>
+  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>.</p>
 
 
   <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>
@@ -38762,10 +38766,9 @@
 
   <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>
+  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>
 
   <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

Modified: source
===================================================================
--- source	2008-12-24 12:29:35 UTC (rev 2575)
+++ source	2008-12-24 12:34:42 UTC (rev 2576)
@@ -43992,13 +43992,15 @@
 
   <p>The <code title="dom-Storage-setItem">setItem()</code> and <code
   title="dom-Storage-removeItem">removeItem()</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>
+  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>
 
   <p>The <dfn 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>
+  be emptied of all key/value pairs, if there are any. If there are
+  none, then the method must do nothing.</p>
 
   <p class="note">When the <code
   title="dom-Storage-setItem">setItem()</code>, <code
@@ -44076,11 +44078,11 @@
   title="dom-Storage-removeItem">removeItem()</code>, and <code
   title="dom-Storage-clear">clear()</code> methods are called on a
   <code>Storage</code> object <var title="">x</var> that is associated
-  with a session storage area, then in every <code>HTMLDocument</code>
-  object whose <code>Window</code> object's <code
-  title="dom-sessionStorage">sessionStorage</code> attribute's
-  <code>Storage</code> object is associated with the same storage
-  area, other than <var title="">x</var>, a <code
+  with a session storage area, if the methods did something, then in
+  every <code>HTMLDocument</code> object whose <code>Window</code>
+  object's <code title="dom-sessionStorage">sessionStorage</code>
+  attribute's <code>Storage</code> object is associated with the same
+  storage area, other than <var title="">x</var>, a <code
   title="event-storage">storage</code> event must be fired, as <span
   title="event-storage">described below</span>.</p>
 
@@ -44121,11 +44123,11 @@
   title="dom-Storage-removeItem">removeItem()</code>, and <code
   title="dom-Storage-clear">clear()</code> methods are called on a
   <code>Storage</code> object <var title="">x</var> that is associated
-  with a local storage area, then in every <code>HTMLDocument</code>
-  object whose <code>Window</code> object's <code
-  title="dom-localStorage">localStorage</code> attribute's
-  <code>Storage</code> object is associated with the same storage
-  area, other than <var title="">x</var>, a <code
+  with a local storage area, if the methods did something, then in
+  every <code>HTMLDocument</code> object whose <code>Window</code>
+  object's <code title="dom-localStorage">localStorage</code>
+  attribute's <code>Storage</code> object is associated with the same
+  storage area, other than <var title="">x</var>, a <code
   title="event-storage">storage</code> event must be fired, as <span
   title="event-storage">described below</span>.</p>
 
@@ -44143,10 +44145,10 @@
 
   <p>When this happens, the user agent must dispatch an event with the
   name <code>storage</code>, with no namespace, which does not bubble
-  but is cancelable, and which uses the <code>StorageEvent</code>, at
-  <span>the body element</span> of each <span title="active
-  document">active</span> <code>HTMLDocument</code> object
-  affected.</p>
+  but is cancelable, and which uses the <code>StorageEvent</code>
+  interface, at <span>the body element</span> of each <span
+  title="active document">active</span> <code>HTMLDocument</code>
+  object affected.</p>
 
   <p>If the event is being fired due to an invocation of the
   <code title="dom-Storage-setItem">setItem()</code> or <code




More information about the Commit-Watchers mailing list