[html5] r1494 - /

whatwg at whatwg.org whatwg at whatwg.org
Sun Apr 27 17:22:52 PDT 2008


Author: ianh
Date: 2008-04-27 17:22:51 -0700 (Sun, 27 Apr 2008)
New Revision: 1494

Modified:
   index
   source
Log:
[gi] (2) Add Storage.clear(); define event dispatch for removeItem() and clear()

Modified: index
===================================================================
--- index	2008-04-27 23:16:24 UTC (rev 1493)
+++ index	2008-04-28 00:22:51 UTC (rev 1494)
@@ -25,7 +25,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=working>Working Draft — 27 April 2008</h2>
+   <h2 class="no-num no-toc" id=working>Working Draft — 28 April 2008</h2>
 
    <p>You can take part in this work. <a
     href="http://www.whatwg.org/mailing-list">Join the working group's
@@ -31855,6 +31855,7 @@
   [NameGetter] DOMString <a href="#getitem" title=dom-Storage-getItem>getItem</a>(in DOMString key);
   [NameSetter] void <a href="#setitem" title=dom-Storage-setItem>setItem</a>(in DOMString key, in DOMString data);
   [XXX] void <a href="#removeitem" title=dom-Storage-removeItem>removeItem</a>(in DOMString key); <!-- XXX [[Delete]] DOMB -->
+  void <a href="#clear0" title=dom-Storage-clear>clear</a>();
 };</pre>
   <!-- XXX v2 ideas:
     a getInfo() method that returns an object that tells you:
@@ -31925,18 +31926,6 @@
    the user has disabled storage for the domain, or if the quota has been
    exceeded.)
 
-  <p>When the <code title=dom-Storage-setItem><a
-   href="#setitem">setItem()</a></code> method is invoked, events are fired
-   on other <code><a href="#htmldocument">HTMLDocument</a></code> objects
-   that can access the newly stored data, as defined in the sections on the
-   <code title=dom-sessionStorage><a
-   href="#sessionstorage">sessionStorage</a></code> and <code
-   title=dom-localStorage><a href="#localstorage">localStorage</a></code>
-   attributes.</p>
-  <!--
-  not normative, see the sections below for the normative statement
-  -->
-
   <p>The <dfn id=removeitem
    title=dom-Storage-removeItem><code>removeItem(<var
    title="">key</var>)</code></dfn> method must cause the key/value pair with
@@ -31951,6 +31940,26 @@
    data storage area must either be successful, or the data storage area must
    not be changed at all.
 
+  <p>The <dfn id=clear0 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>When the <code title=dom-Storage-setItem><a
+   href="#setitem">setItem()</a></code>, <code
+   title=dom-Storage-removeItem><a
+   href="#removeitem">removeItem()</a></code>, and <code
+   title=dom-Storage-clear><a href="#clear0">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="#sessionstorage">sessionStorage</a></code> and <code
+   title=dom-localStorage><a href="#localstorage">localStorage</a></code>
+   attributes.</p>
+  <!--
+  not normative, see the sections below for the normative statement
+  -->
+
   <h4 id=the-sessionstorage><span class=secno>4.10.3 </span>The <code
    title=dom-sessionStorage><a
    href="#sessionstorage">sessionStorage</a></code> attribute</h4>
@@ -32008,11 +32017,14 @@
    other in any way.
 
   <p id=sessionStorageEvent>When the <code title=dom-Storage-setItem><a
-   href="#setitem">setItem()</a></code> method is called on a <code><a
-   href="#storage0">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
+   href="#setitem">setItem()</a></code>, <code
+   title=dom-Storage-removeItem><a
+   href="#removeitem">removeItem()</a></code>, and <code
+   title=dom-Storage-clear><a href="#clear0">clear()</a></code> methods are
+   called on a <code><a href="#storage0">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="#sessionstorage">sessionStorage</a></code> attribute's <code><a
    href="#storage0">Storage</a></code> object is associated with the same
@@ -32051,16 +32063,20 @@
    local storage area, and return it.
 
   <p id=localStorageEvent>When the <code title=dom-Storage-setItem><a
-   href="#setitem">setItem()</a></code> method is called on a <code><a
-   href="#storage0">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="#localstorage">localStorage</a></code> attribute's <code><a
-   href="#storage0">Storage</a></code> object is associated with the same
-   storage area, other than <var title="">x</var>, a <code
-   title=event-storage><a href="#storage1">storage</a></code> event must be
-   fired, as <a href="#storage1" title=event-storage>described below</a>.
+   href="#setitem">setItem()</a></code>, <code
+   title=dom-Storage-removeItem><a
+   href="#removeitem">removeItem()</a></code>, and <code
+   title=dom-Storage-clear><a href="#clear0">clear()</a></code> methods are
+   called on a <code><a href="#storage0">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="#localstorage">localStorage</a></code>
+   attribute's <code><a href="#storage0">Storage</a></code> object is
+   associated with the same storage area, other than <var title="">x</var>, a
+   <code title=event-storage><a href="#storage1">storage</a></code> event
+   must be fired, as <a href="#storage1" title=event-storage>described
+   below</a>.
 
   <h4 id=the-storage0><span class=secno>4.10.5 </span>The <code
    title=event-storage><a href="#storage1">storage</a></code> event</h4>
@@ -32077,19 +32093,34 @@
    href="#storageevent">StorageEvent</a></code>, at <a href="#the-body1">the
    body element</a> of each <a href="#active" title="active
    document">active</a> <code><a href="#htmldocument">HTMLDocument</a></code>
-   object affected. The event must have its <code
-   title=dom-StorageEvent-key><a href="#key">key</a></code> attribute set to
-   the name of the key in question, its <code
-   title=dom-StorageEvent-oldValue><a href="#oldvalue">oldValue</a></code>
-   attribute set to the old value of the key in question, or null if the key
-   is newly added, its <code title=dom-StorageEvent-newValue>newValue</code>
-   attribute set to the new value of the key in question, or null if the key
-   was removed, its <code title=dom-StorageEvent-uri><a
+   object affected.
+
+  <p>If the event is being fired due to an invocation of the <code
+   title=dom-Storage-setItem><a href="#setitem">setItem()</a></code> or <code
+   title=dom-Storage-removeItem><a href="#removeitem">removeItem()</a></code>
+   methods, the event must have its <code title=dom-StorageEvent-key><a
+   href="#key">key</a></code> attribute set to the name of the key in
+   question, its <code title=dom-StorageEvent-oldValue><a
+   href="#oldvalue">oldValue</a></code> attribute set to the old value of the
+   key in question, or null if the key is newly added, and its <code
+   title=dom-StorageEvent-newValue>newValue</code> attribute set to the new
+   value of the key in question, or null if the key was removed.
+
+  <p>Otherwise, if the event is being fired due to an invocation of the <code
+   title=dom-Storage-clear><a href="#clear0">clear()</a></code> method, the
+   event must have its <code title=dom-StorageEvent-key><a
+   href="#key">key</a></code>, <code title=dom-StorageEvent-oldValue><a
+   href="#oldvalue">oldValue</a></code>, and <code
+   title=dom-StorageEvent-newValue>newValue</code> attributes set to null.
+
+  <p>In addition, the event must have its <code title=dom-StorageEvent-uri><a
    href="#uri">uri</a></code> attribute set to the address of the page whose
    <code><a href="#storage0">Storage</a></code> object was affected, and its
    <code title=dom-StorageEvent-source><a href="#source0">source</a></code>
    attribute set to the <code><a href="#window">Window</a></code> object of
-   the <span>browsing content</span> that that documents finds is in.</p>
+   the <span>browsing content</span> that that document is in, if the two
+   documents are in the same <a href="#unit-of">unit of related browsing
+   contexts</a>, or null otherwise.</p>
   <!-- XXX onstorage should be defined -->
 
   <h5 id=event0><span class=secno>4.10.5.1. </span>Event definition</h5>
@@ -40490,7 +40521,7 @@
    first and the most recently added element last (except for while steps 8
    to 11 of the above algorithm are being executed, of course).
 
-  <p>When the steps below require the UA to <dfn id=clear0>clear the list of
+  <p>When the steps below require the UA to <dfn id=clear1>clear the list of
    active formatting elements up to the last marker</dfn>, the UA must
    perform the following steps:
 
@@ -44276,7 +44307,7 @@
        until an element with the same tag name as the token has been popped
        from the stack.
 
-     <li><a href="#clear0">Clear the list of active formatting elements up to
+     <li><a href="#clear1">Clear the list of active formatting elements up to
       the last marker</a>.
     </ol>
 
@@ -44666,7 +44697,7 @@
    <dt>A start tag whose tag name is "caption"
 
    <dd>
-    <p><a href="#clear1">Clear the stack back to a table context</a>. (See
+    <p><a href="#clear2">Clear the stack back to a table context</a>. (See
      below.)</p>
 
     <p>Insert a marker at the end of the <a href="#list-of4">list of active
@@ -44679,7 +44710,7 @@
    <dt>A start tag whose tag name is "colgroup"
 
    <dd>
-    <p><a href="#clear1">Clear the stack back to a table context</a>. (See
+    <p><a href="#clear2">Clear the stack back to a table context</a>. (See
      below.)</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token, then
@@ -44695,7 +44726,7 @@
    <dt>A start tag whose tag name is one of: "tbody", "tfoot", "thead"
 
    <dd>
-    <p><a href="#clear1">Clear the stack back to a table context</a>. (See
+    <p><a href="#clear2">Clear the stack back to a table context</a>. (See
      below.)</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token, then
@@ -44836,7 +44867,7 @@
      the <i><a href="#foster">foster parent element</a></i>.</p>
   </dl>
 
-  <p>When the steps above require the UA to <dfn id=clear1>clear the stack
+  <p>When the steps above require the UA to <dfn id=clear2>clear the stack
    back to a table context</dfn>, it means that the UA must, while the <a
    href="#current5">current node</a> is not a <code><a
    href="#table">table</a></code> element or an <code><a
@@ -44877,7 +44908,7 @@
      href="#caption0">caption</a></code> element has been popped from the
      stack.</p>
 
-    <p><a href="#clear0">Clear the list of active formatting elements up to
+    <p><a href="#clear1">Clear the list of active formatting elements up to
      the last marker</a>.</p>
 
     <p>Switch the <span>insertion mode</span> to "<a href="#in-table"
@@ -45007,7 +45038,7 @@
    <dt>A start tag whose tag name is "tr"
 
    <dd>
-    <p><a href="#clear2">Clear the stack back to a table body context</a>.
+    <p><a href="#clear3">Clear the stack back to a table body context</a>.
      (See below.)</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token, then
@@ -45030,7 +45061,7 @@
 
     <p>Otherwise:</p>
 
-    <p><a href="#clear2">Clear the stack back to a table body context</a>.
+    <p><a href="#clear3">Clear the stack back to a table body context</a>.
      (See below.)</p>
 
     <p>Pop the <a href="#current5">current node</a> from the <a
@@ -45052,7 +45083,7 @@
 
     <p>Otherwise:</p>
 
-    <p><a href="#clear2">Clear the stack back to a table body context</a>.
+    <p><a href="#clear3">Clear the stack back to a table body context</a>.
      (See below.)</p>
 
     <p>Act as if an end tag with the same tag name as the <a
@@ -45073,7 +45104,7 @@
      <span>insertion mode</span>.</p>
   </dl>
 
-  <p>When the steps above require the UA to <dfn id=clear2>clear the stack
+  <p>When the steps above require the UA to <dfn id=clear3>clear the stack
    back to a table body context</dfn>, it means that the UA must, while the
    <a href="#current5">current node</a> is not a <code><a
    href="#tbody">tbody</a></code>, <code><a href="#tfoot0">tfoot</a></code>,
@@ -45096,7 +45127,7 @@
    <dt>A start tag whose tag name is one of: "th", "td"
 
    <dd>
-    <p><a href="#clear3">Clear the stack back to a table row context</a>.
+    <p><a href="#clear4">Clear the stack back to a table row context</a>.
      (See below.)</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token, then
@@ -45117,7 +45148,7 @@
 
     <p>Otherwise:</p>
 
-    <p><a href="#clear3">Clear the stack back to a table row context</a>.
+    <p><a href="#clear4">Clear the stack back to a table row context</a>.
      (See below.)</p>
 
     <p>Pop the <a href="#current5">current node</a> (which will be a <code><a
@@ -45163,7 +45194,7 @@
      <span>insertion mode</span>.</p>
   </dl>
 
-  <p>When the steps above require the UA to <dfn id=clear3>clear the stack
+  <p>When the steps above require the UA to <dfn id=clear4>clear the stack
    back to a table row context</dfn>, it means that the UA must, while the <a
    href="#current5">current node</a> is not a <code><a
    href="#tr">tr</a></code> element or an <code><a
@@ -45202,7 +45233,7 @@
     <p>Pop elements from this stack until an element with the same tag name
      as the token has been popped from the stack.</p>
 
-    <p><a href="#clear0">Clear the list of active formatting elements up to
+    <p><a href="#clear1">Clear the list of active formatting elements up to
      the last marker</a>.</p>
 
     <p>Switch the <span>insertion mode</span> to "<a href="#in-row"

Modified: source
===================================================================
--- source	2008-04-27 23:16:24 UTC (rev 1493)
+++ source	2008-04-28 00:22:51 UTC (rev 1494)
@@ -29584,6 +29584,7 @@
   [NameGetter] DOMString <span title="dom-Storage-getItem">getItem</span>(in DOMString key);
   [NameSetter] void <span title="dom-Storage-setItem">setItem</span>(in DOMString key, in DOMString data);
   [XXX] void <span title="dom-Storage-removeItem">removeItem</span>(in DOMString key); <!-- XXX [[Delete]] DOMB -->
+  void <span title="dom-Storage-clear">clear</span>();
 };</pre>
 
   <!-- XXX v2 ideas:
@@ -29655,15 +29656,6 @@
   e.g., the user has disabled storage for the domain, or if the quota
   has been exceeded.)</p>
 
-  <p>When the <code title="dom-Storage-setItem">setItem()</code>
-  method is invoked, events are fired on other
-  <code>HTMLDocument</code> objects that can access the newly stored
-  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 below for the normative statement
-  -->
-
   <p>The <dfn title="dom-Storage-removeItem"><code>removeItem(<var
   title="">key</var>)</code></dfn> method must cause the key/value
   pair with the given <var title="">key</var> to be removed from the
@@ -29676,7 +29668,21 @@
   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>
 
+  <p>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 other <code>HTMLDocument</code> objects 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 below for the normative statement
+  -->
+
+
   <h4>The <code title="dom-sessionStorage">sessionStorage</code> attribute</h4>
 
   <p>The <dfn
@@ -29730,7 +29736,9 @@
   considered separate, not affecting each other in any way.</p>
 
   <p id="sessionStorageEvent">When the <code
-  title="dom-Storage-setItem">setItem()</code> method is called on a
+  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, then in every <code>HTMLDocument</code>
   object whose <code>Window</code> object's <code
@@ -29769,7 +29777,9 @@
   it.</p>
 
   <p id="localStorageEvent">When the <code
-  title="dom-Storage-setItem">setItem()</code> method is called on a
+  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, then in every <code>HTMLDocument</code>
   object whose <code>Window</code> object's <code
@@ -29793,19 +29803,34 @@
   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. The event must have its <code
-  title="dom-StorageEvent-key">key</code> attribute set to the name of
-  the key in question, its <code
+  affected.</p>
+
+  <p>If the event is being fired due to an invocation of the
+  <code title="dom-Storage-setItem">setItem()</code> or <code
+  title="dom-Storage-removeItem">removeItem()</code> methods, the
+  event must have its <code title="dom-StorageEvent-key">key</code>
+  attribute set to the name of the key in question, its <code
   title="dom-StorageEvent-oldValue">oldValue</code> attribute set to
   the old value of the key in question, or null if the key is newly
-  added, its <code title="dom-StorageEvent-newValue">newValue</code>
+  added, and its <code title="dom-StorageEvent-newValue">newValue</code>
   attribute set to the new value of the key in question, or null if
-  the key was removed, its <code
+  the key was removed.</p>
+
+  <p>Otherwise, if the event is being fired due to an invocation of
+  the <code title="dom-Storage-clear">clear()</code> method, the event
+  must have its <code title="dom-StorageEvent-key">key</code>, <code
+  title="dom-StorageEvent-oldValue">oldValue</code>, and <code
+  title="dom-StorageEvent-newValue">newValue</code> attributes set to
+  null.</p>
+
+  <p>In addition, the event must have its <code
   title="dom-StorageEvent-uri">uri</code> attribute set to the address
   of the page whose <code>Storage</code> object was affected, and its
   <code title="dom-StorageEvent-source">source</code> attribute set to
   the <code>Window</code> object of the <span>browsing content</span>
-  that that documents finds is in.</p>
+  that that document is in, if the two documents are in the same
+  <span>unit of related browsing contexts</span>, or null
+  otherwise.</p>
 
   <!-- XXX onstorage should be defined -->
 




More information about the Commit-Watchers mailing list