Skip to content

Commit

Permalink
[giow] (2) Try to clarify when 'storage' even fires.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=19540
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@7615 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 30, 2012
1 parent a898f54 commit 35e83df
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 48 deletions.
27 changes: 12 additions & 15 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -85901,8 +85901,9 @@ <h4 id=the-storage-interface><span class=secno>11.2.1 </span>The <code><a href=#
list, with the given <var title="">key</var> and with its value set
to <var title="">value</var>.</p>

<p>If the given <var title="">key</var> <em>does</em> exist in the
list, then it must have its value updated to <var title="">value</var>.</p>
<p>If the given <var title="">key</var> <em>does</em> exist in the list, and its value is not
equal to <var title="">value</var>, then it must have its value updated to <var title="">value</var>. If its previous value <em>is</em> equal to <var title="">value</var>, then
the method must do nothing.</p>

<p>If it couldn't set the new value, the method must throw an
<code><a href=#quotaexceedederror>QuotaExceededError</a></code> exception. (Setting could fail if,
Expand All @@ -85926,7 +85927,7 @@ <h4 id=the-storage-interface><span class=secno>11.2.1 </span>The <code><a href=#
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 the
<code><a href=#window>Window</a></code> objecys of other <code><a href=#document>Document</a></code>s that can access the newly stored or
<code><a href=#window>Window</a></code> objects of other <code><a href=#document>Document</a></code>s 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> <!-- not normative, see the sections
below for the normative statement -->

Expand Down Expand Up @@ -86005,10 +86006,10 @@ <h4 id=the-sessionstorage-attribute><span class=secno>11.2.2 </span>The <code ti
on, however, the two session storage areas must be considered
separate, not affecting each other in any way.</p>

<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, if the methods did something,
then for every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage
notification</a>.
<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, if the methods did not throw an
exception or "do nothing" as defined above, then for every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage notification</a>.</p>


<h4 id=the-localstorage-attribute><span class=secno>11.2.3 </span>The <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute</h4>
Expand Down Expand Up @@ -86058,14 +86059,10 @@ <h4 id=the-localstorage-attribute><span class=secno>11.2.3 </span>The <code titl
origin's local storage area. Each <code><a href=#document>Document</a></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>

</ol><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, if the methods did something, then for
every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage
notification</a>.
</ol><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, if the methods did not throw an
exception or "do nothing" as defined above, then for every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage notification</a>.

<p id=localStorageMutex>Whenever the properties of a <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute's
<code><a href=#storage-0>Storage</a></code> object are to be examined, returned, set, or
Expand Down
27 changes: 12 additions & 15 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -85901,8 +85901,9 @@ callback <dfn id=portcollectioncallback>PortCollectionCallback</dfn> = void (<a
list, with the given <var title="">key</var> and with its value set
to <var title="">value</var>.</p>

<p>If the given <var title="">key</var> <em>does</em> exist in the
list, then it must have its value updated to <var title="">value</var>.</p>
<p>If the given <var title="">key</var> <em>does</em> exist in the list, and its value is not
equal to <var title="">value</var>, then it must have its value updated to <var title="">value</var>. If its previous value <em>is</em> equal to <var title="">value</var>, then
the method must do nothing.</p>

<p>If it couldn't set the new value, the method must throw an
<code><a href=#quotaexceedederror>QuotaExceededError</a></code> exception. (Setting could fail if,
Expand All @@ -85926,7 +85927,7 @@ callback <dfn id=portcollectioncallback>PortCollectionCallback</dfn> = void (<a
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 the
<code><a href=#window>Window</a></code> objecys of other <code><a href=#document>Document</a></code>s that can access the newly stored or
<code><a href=#window>Window</a></code> objects of other <code><a href=#document>Document</a></code>s 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> <!-- not normative, see the sections
below for the normative statement -->

Expand Down Expand Up @@ -86005,10 +86006,10 @@ interface <dfn id=windowsessionstorage>WindowSessionStorage</dfn> {
on, however, the two session storage areas must be considered
separate, not affecting each other in any way.</p>

<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, if the methods did something,
then for every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage
notification</a>.
<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, if the methods did not throw an
exception or "do nothing" as defined above, then for every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage notification</a>.</p>


<h4 id=the-localstorage-attribute><span class=secno>11.2.3 </span>The <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute</h4>
Expand Down Expand Up @@ -86058,14 +86059,10 @@ interface <dfn id=windowlocalstorage>WindowLocalStorage</dfn> {
origin's local storage area. Each <code><a href=#document>Document</a></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>

</ol><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, if the methods did something, then for
every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage
notification</a>.
</ol><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, if the methods did not throw an
exception or "do nothing" as defined above, then for every <code><a href=#document>Document</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 href=#send-a-storage-notification>send a storage notification</a>.

<p id=localStorageMutex>Whenever the properties of a <code title=dom-localStorage><a href=#dom-localstorage>localStorage</a></code> attribute's
<code><a href=#storage-0>Storage</a></code> object are to be examined, returned, set, or
Expand Down
35 changes: 17 additions & 18 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -99735,8 +99735,10 @@ callback <dfn>PortCollectionCallback</dfn> = void (<span>MessagePort</span> port
list, with the given <var title="">key</var> and with its value set
to <var title="">value</var>.</p>

<p>If the given <var title="">key</var> <em>does</em> exist in the
list, then it must have its value updated to <var title="">value</var>.</p>
<p>If the given <var title="">key</var> <em>does</em> exist in the list, and its value is not
equal to <var title="">value</var>, then it must have its value updated to <var
title="">value</var>. If its previous value <em>is</em> equal to <var title="">value</var>, then
the method must do nothing.</p>

<p>If it couldn't set the new value, the method must throw an
<code>QuotaExceededError</code> exception. (Setting could fail if,
Expand Down Expand Up @@ -99764,7 +99766,7 @@ callback <dfn>PortCollectionCallback</dfn> = void (<span>MessagePort</span> port
<p class="note">When the <code title="dom-Storage-setItem">setItem()</code>, <code
title="dom-Storage-removeItem">removeItem()</code>, and <code
title="dom-Storage-clear">clear()</code> methods are invoked, events are fired on the
<code>Window</code> objecys of other <code>Document</code>s that can access the newly stored or
<code>Window</code> objects of other <code>Document</code>s that can access the newly stored or
removed data, as defined in the sections on the <code
title="dom-sessionStorage">sessionStorage</code> and <code
title="dom-localStorage">localStorage</code> attributes.</p> <!-- not normative, see the sections
Expand Down Expand Up @@ -99850,11 +99852,11 @@ interface <dfn>WindowSessionStorage</dfn> {
<p id="sessionStorageEvent">When the <code title="dom-Storage-setItem">setItem()</code>, <code
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, if the methods did something,
then for every <code>Document</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>, <span>send a storage
notification</span>.
title="">x</var> that is associated with a session storage area, if the methods did not throw an
exception or "do nothing" as defined above, then for every <code>Document</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>, <span>send a storage notification</span>.</p>


<h5>The <code title="dom-localStorage">localStorage</code> attribute</h5>
Expand Down Expand Up @@ -99909,17 +99911,14 @@ interface <dfn>WindowLocalStorage</dfn> {

</ol>

<p id="localStorageEvent">When the <code
title="dom-Storage-setItem">setItem()</code>, <code
<p id="localStorageEvent">When the <code title="dom-Storage-setItem">setItem()</code>, <code
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, if the methods did something, then for
every <code>Document</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>, <span>send a storage
notification</span>.
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, if the methods did not throw an
exception or "do nothing" as defined above, then for every <code>Document</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>, <span>send a storage notification</span>.

<p id="localStorageMutex">Whenever the properties of a <code
title="dom-localStorage">localStorage</code> attribute's
Expand Down

0 comments on commit 35e83df

Please sign in to comment.