Skip to content

Commit

Permalink
[giw] (2) Don't fire a 'storage' event if the methods did nothing. (c…
Browse files Browse the repository at this point in the history
…redit: pt)

git-svn-id: http://svn.whatwg.org/webapps@2576 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 24, 2008
1 parent 9faf431 commit 803534e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
35 changes: 19 additions & 16 deletions index
Expand Up @@ -38632,13 +38632,15 @@ user reload must be equivalent to .reload()
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
Expand Down Expand Up @@ -38707,10 +38709,11 @@ user reload must be equivalent to .reload()

<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>
Expand Down Expand Up @@ -38745,10 +38748,11 @@ user reload must be equivalent to .reload()

<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>
Expand All @@ -38762,10 +38766,9 @@ user reload must be equivalent to .reload()

<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
Expand Down
38 changes: 20 additions & 18 deletions source
Expand Up @@ -43992,13 +43992,15 @@ user reload must be equivalent to .reload()

<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
Expand Down Expand Up @@ -44076,11 +44078,11 @@ user reload must be equivalent to .reload()
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>

Expand Down Expand Up @@ -44121,11 +44123,11 @@ user reload must be equivalent to .reload()
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>

Expand All @@ -44143,10 +44145,10 @@ user reload must be equivalent to .reload()

<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
Expand Down

0 comments on commit 803534e

Please sign in to comment.