[html5] r2347 - [gwr] (2) Allow an obsolete appcache to be renewed. Move the manifest storing to [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Oct 16 03:53:24 PDT 2008


Author: ianh
Date: 2008-10-16 03:53:23 -0700 (Thu, 16 Oct 2008)
New Revision: 2347

Modified:
   index
   source
Log:
[gwr] (2) Allow an obsolete appcache to be renewed. Move the manifest storing to later in the process to reduce more race conditions. Use 'obsolete' as the event name instead of 'error' when the cache is made obsolete. Support obsolete caches in the API.

Modified: index
===================================================================
--- index	2008-10-16 10:32:32 UTC (rev 2346)
+++ index	2008-10-16 10:53:23 UTC (rev 2347)
@@ -33835,16 +33835,13 @@
   <p>Each group of application caches for the same manifest URL has a
   common <dfn id=concept-appcache-status title=concept-appcache-status>update status</dfn>,
   which is one of the following: <i>idle</i>, <i>checking</i>,
-  <i>downloading</i>. Initially, the <a href=#concept-appcache-status title=concept-appcache-status>update status</a> of a group of
-  application caches is <i>idle</i>.</p>
+  <i>downloading</i>.</p>
 
   <p>Each group of application caches for the same manifest URL also
   has a common <dfn id=concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle
   status</dfn>, which is one of the following: <i>new</i>,
-  <i>mature</i>, <i>obsolete</i>. Initially, when the first applicaion
-  cache in a group is created, its <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle status</a> is
-  <i>new</i>. A <dfn id=relevant-application-cache>relevant application cache</dfn> is an
-  <a href=#application-cache>application cache</a> whose <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle status</a> is
+  <i>mature</i>, <i>obsolete</i>. A <dfn id=relevant-application-cache>relevant application
+  cache</dfn> is an <a href=#application-cache>application cache</a> whose <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle status</a> is
   <i>mature</i>.</p>
 
   <p id=appcache-history-1>A <a href=#browsing-context>browsing context</a> is
@@ -34351,7 +34348,8 @@
      specific cache), and there is no <a href=#application-cache>application cache</a>
      identified by <var title="">manifest URL</var> whose <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle status</a> is not
      <i>obsolete</i>, then create a new <a href=#application-cache>application cache</a>
-     identified with that URL.</li>
+     identified with that URL and set the group's <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle status</a> to
+     <i>new</i>.</li>
 
      <li id=flagAsCandidateForCache><p>If these steps were invoked
      with a new <a href=#concept-appcache-master title=concept-appcache-master>master</a>
@@ -34616,10 +34614,6 @@
 
     </ol></li>
 
-   <li><p>Store <var title="">manifest</var> in <var title="">new
-   cache</var>, if it's not there already, and categorize this entry
-   (whether newly added or not) as <a href=#concept-appcache-manifest title=concept-appcache-manifest>the manifest</a>.</li>
-
    <li><p>Store the list of <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespaces</a>,
    and the URLs of the <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entries</a> that they
    map to, in <var title="">new cache</var>.</li>
@@ -34645,6 +34639,10 @@
 
    </li>
 
+   <li><p>Store <var title="">manifest</var> in <var title="">new
+   cache</var>, if it's not there already, and categorize this entry
+   (whether newly added or not) as <a href=#concept-appcache-manifest title=concept-appcache-manifest>the manifest</a>.</li>
+
    <li>
 
     <p>If this is a <a href=#concept-appcache-cache title=concept-appcache-cache>cache
@@ -34695,13 +34693,13 @@
    attempt</a>, then discard <var title="">cache</var> and abort
    the update process.</li>
 
-   <li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> at the
+   <li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-obsolete>obsolete</code> at the
    <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
    context</a> whose <a href=#active-document>active document</a> is associated
    with a cache in <var title="">cache group</var>. The default action
    of this event should be the display of some sort of user interface
    indicating to the user that the application is no longer available
-   for offline use.</li> <!-- XXX another event maybe? -->
+   for offline use.</li>
 
    <li><p>Set the <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle
    status</a> of <var title="">cache group</var> to
@@ -34944,6 +34942,7 @@
   const unsigned short <a href=#dom-appcache-checking title=dom-appcache-CHECKING>CHECKING</a> = 2;
   const unsigned short <a href=#dom-appcache-downloading title=dom-appcache-DOWNLOADING>DOWNLOADING</a> = 3;
   const unsigned short <a href=#dom-appcache-updateready title=dom-appcache-UPDATEREADY>UPDATEREADY</a> = 4;
+  const unsigned short <a href=#dom-appcache-obsolete title=dom-appcache-OBSOLETE>OBSOLETE</a> = 5;
   readonly attribute unsigned short <a href=#dom-appcache-status title=dom-appcache-status>status</a>;
 
   // updates
@@ -34964,6 +34963,7 @@
            attribute <span>EventListener</span> <a href=#handler-appcache-onprogress title=handler-appcache-onprogress>onprogress</a>;
            attribute <span>EventListener</span> <a href=#handler-appcache-onupdateready title=handler-appcache-onupdateready>onupdateready</a>;
            attribute <span>EventListener</span> <a href=#handler-appcache-oncached title=handler-appcache-oncached>oncached</a>;
+           attribute <span>EventListener</span> <a href=#handler-appcache-onobsolete title=handler-appcache-onobsolete>onobsolete</a>;
 
 };</pre>
 
@@ -35004,35 +35004,45 @@
 
    <dd><p>The <code><a href=#applicationcache>ApplicationCache</a></code> object is associated with
    an <a href=#application-cache>application cache</a> whose group is in the <i>idle</i>
-   <span title=concept-appcache-states>update status</span>, and
-   that application cache is the newest cache in its group that
-   contains a resource categorized as a <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>.</dd>
+   <a href=#concept-appcache-status title=concept-appcache-status>update status</a> and the
+   <i>mature</i> <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle
+   status</a> and that application cache is the newest cache in its
+   group.</dd>
 
    <dt><dfn id=dom-appcache-checking title=dom-appcache-CHECKING><code>CHECKING</code></dfn>
    (numeric value 2)</dt>
 
    <dd><p>The <code><a href=#applicationcache>ApplicationCache</a></code> object is associated with
    an <a href=#application-cache>application cache</a> whose group is in the
-   <i>checking</i> <span title=concept-appcache-states>update
-   status</span>.</dd>
+   <i>checking</i> <a href=#concept-appcache-status title=concept-appcache-status>update
+   status</a>.</dd>
 
    <dt><dfn id=dom-appcache-downloading title=dom-appcache-DOWNLOADING><code>DOWNLOADING</code></dfn>
    (numeric value 3)</dt>
 
    <dd><p>The <code><a href=#applicationcache>ApplicationCache</a></code> object is associated with
    an <a href=#application-cache>application cache</a> whose group is in the
-   <i>downloading</i> <span title=concept-appcache-states>update
-   status</span>.</dd>
+   <i>downloading</i> <a href=#concept-appcache-status title=concept-appcache-status>update
+   status</a>.</dd>
 
    <dt><dfn id=dom-appcache-updateready title=dom-appcache-UPDATEREADY><code>UPDATEREADY</code></dfn>
    (numeric value 4)</dt>
 
    <dd><p>The <code><a href=#applicationcache>ApplicationCache</a></code> object is associated with
    an <a href=#application-cache>application cache</a> whose group is in the <i>idle</i>
-   <span title=concept-appcache-states>update status</span>, but
-   that application cache is <em>not</em> the newest cache in its
-   group that contains a resource categorized as a <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>.</dd>
+   <a href=#concept-appcache-status title=concept-appcache-status>update status</a> and the
+   <i>mature</i> <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle
+   status</a> but that application cache is <em>not</em> the newest
+   cache in its group.</dd>
 
+   <dt><dfn id=dom-appcache-obsolete title=dom-appcache-OBSOLETE><code>OBSOLETE</code></dfn>
+   (numeric value 5)</dt>
+
+   <dd><p>The <code><a href=#applicationcache>ApplicationCache</a></code> object is associated with
+   an <a href=#application-cache>application cache</a> whose group is in the
+   <i>obsolete</i> <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle
+   status</a>.</dd>
+
   </dl><p>The <dfn id=dom-appcache-length title=dom-appcache-length><code>length</code></dfn>
   attribute must return the number of <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entries</a> in the
   <a href=#application-cache>application cache</a> with which the
@@ -35153,11 +35163,16 @@
    associated. (By definition, this is the same as the one that was
    found in the previous step.)</li>
 
-   <li><p>Check that there is an application cache in the same group
-   as <var title="">cache</var> which has an entry categorized as a
-   <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> that has is
-   newer than <var title="">cache</var>. If there is not, then raise
-   an <code>INVALID_STATE_ERR</code> exception and abort these
+   <li><p>If the group of <a href=#application-cache title="application cache">application
+   caches</a> to which <var title="">cache</var> belongs has the
+   <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle status</a>
+   <i>obsolete</i>, unassociate <var title="">document</var> from <var title="">cache</var> and abort these steps.</li>
+
+   <li><p>Otherwise, check that there is an application cache in the
+   same group as <var title="">cache</var> which has an entry
+   categorized as a <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> that is newer
+   than <var title="">cache</var>. If there is not, then raise an
+   <code>INVALID_STATE_ERR</code> exception and abort these
    steps.</li>
 
    <li><p>Let <var title="">new cache</var> be the newest
@@ -35212,6 +35227,12 @@
    <dd><p>Must be invoked whenever a <code title=event-cached>cached</code> event is targeted at or bubbles
    through the <code><a href=#applicationcache>ApplicationCache</a></code> object.</dd>
 
+
+   <dt><dfn id=handler-appcache-onobsolete title=handler-appcache-onobsolete><code>onobsolete</code></dfn></dt>
+
+   <dd><p>Must be invoked whenever an <code title=event-obsolete>obsolete</code> event is targeted at or bubbles
+   through the <code><a href=#applicationcache>ApplicationCache</a></code> object.</dd>
+
   </dl><h4 id=browser-state><span class=secno>5.7.7 </span>Browser state</h4>
 
   <p>The <dfn id=dom-navigator-online title=dom-navigator-onLine><code>navigator.onLine</code></dfn>

Modified: source
===================================================================
--- source	2008-10-16 10:32:32 UTC (rev 2346)
+++ source	2008-10-16 10:53:23 UTC (rev 2347)
@@ -38390,19 +38390,14 @@
   <p>Each group of application caches for the same manifest URL has a
   common <dfn title="concept-appcache-status">update status</dfn>,
   which is one of the following: <i>idle</i>, <i>checking</i>,
-  <i>downloading</i>. Initially, the <span
-  title="concept-appcache-status">update status</span> of a group of
-  application caches is <i>idle</i>.</p>
+  <i>downloading</i>.</p>
 
   <p>Each group of application caches for the same manifest URL also
   has a common <dfn title="concept-appcache-lifecycle">lifecycle
   status</dfn>, which is one of the following: <i>new</i>,
-  <i>mature</i>, <i>obsolete</i>. Initially, when the first applicaion
-  cache in a group is created, its <span
+  <i>mature</i>, <i>obsolete</i>. A <dfn>relevant application
+  cache</dfn> is an <span>application cache</span> whose <span
   title="concept-appcache-lifecycle">lifecycle status</span> is
-  <i>new</i>. A <dfn>relevant application cache</dfn> is an
-  <span>application cache</span> whose <span
-  title="concept-appcache-lifecycle">lifecycle status</span> is
   <i>mature</i>.</p>
 
   <p id="appcache-history-1">A <span>browsing context</span> is
@@ -38999,7 +38994,9 @@
      identified by <var title="">manifest URL</var> whose <span
      title="concept-appcache-lifecycle">lifecycle status</span> is not
      <i>obsolete</i>, then create a new <span>application cache</span>
-     identified with that URL.</p></li>
+     identified with that URL and set the group's <span
+     title="concept-appcache-lifecycle">lifecycle status</span> to
+     <i>new</i>.</p></li>
 
      <li id="flagAsCandidateForCache"><p>If these steps were invoked
      with a new <span title="concept-appcache-master">master</span>
@@ -39309,11 +39306,6 @@
 
    </li>
 
-   <li><p>Store <var title="">manifest</var> in <var title="">new
-   cache</var>, if it's not there already, and categorize this entry
-   (whether newly added or not) as <span
-   title="concept-appcache-manifest">the manifest</span>.</p></li>
-
    <li><p>Store the list of <span
    title="concept-appcache-fallback-ns">fallback namespaces</span>,
    and the URLs of the <span
@@ -39343,6 +39335,11 @@
 
    </li>
 
+   <li><p>Store <var title="">manifest</var> in <var title="">new
+   cache</var>, if it's not there already, and categorize this entry
+   (whether newly added or not) as <span
+   title="concept-appcache-manifest">the manifest</span>.</p></li>
+
    <li>
 
     <p>If this is a <span title="concept-appcache-cache">cache
@@ -39402,13 +39399,13 @@
    the update process.</p></li>
 
    <li><p><span>Fire a simple event</span> called <code
-   title="event-error">error</code> at the
+   title="event-obsolete">obsolete</code> at the
    <code>ApplicationCache</code> singleton of each <span>browsing
    context</span> whose <span>active document</span> is associated
    with a cache in <var title="">cache group</var>. The default action
    of this event should be the display of some sort of user interface
    indicating to the user that the application is no longer available
-   for offline use.</p></li> <!-- XXX another event maybe? -->
+   for offline use.</p></li>
 
    <li><p>Set the <span title="concept-appcache-lifecycle">lifecycle
    status</span> of <var title="">cache group</var> to
@@ -39696,6 +39693,7 @@
   const unsigned short <span title="dom-appcache-CHECKING">CHECKING</span> = 2;
   const unsigned short <span title="dom-appcache-DOWNLOADING">DOWNLOADING</span> = 3;
   const unsigned short <span title="dom-appcache-UPDATEREADY">UPDATEREADY</span> = 4;
+  const unsigned short <span title="dom-appcache-OBSOLETE">OBSOLETE</span> = 5;
   readonly attribute unsigned short <span title="dom-appcache-status">status</span>;
 
   // updates
@@ -39716,6 +39714,7 @@
            attribute <span>EventListener</span> <span title="handler-appcache-onprogress">onprogress</span>;
            attribute <span>EventListener</span> <span title="handler-appcache-onupdateready">onupdateready</span>;
            attribute <span>EventListener</span> <span title="handler-appcache-oncached">oncached</span>;
+           attribute <span>EventListener</span> <span title="handler-appcache-onobsolete">onobsolete</span>;
 
 };</pre>
 
@@ -39759,17 +39758,17 @@
 
    <dd><p>The <code>ApplicationCache</code> object is associated with
    an <span>application cache</span> whose group is in the <i>idle</i>
-   <span title="concept-appcache-states">update status</span>, and
-   that application cache is the newest cache in its group that
-   contains a resource categorized as a <span
-   title="concept-appcache-manifest">manifest</span>.</p></dd>
+   <span title="concept-appcache-status">update status</span> and the
+   <i>mature</i> <span title="concept-appcache-lifecycle">lifecycle
+   status</span> and that application cache is the newest cache in its
+   group.</p></dd>
 
    <dt><dfn title="dom-appcache-CHECKING"><code>CHECKING</code></dfn>
    (numeric value 2)</dt>
 
    <dd><p>The <code>ApplicationCache</code> object is associated with
    an <span>application cache</span> whose group is in the
-   <i>checking</i> <span title="concept-appcache-states">update
+   <i>checking</i> <span title="concept-appcache-status">update
    status</span>.</p></dd>
 
    <dt><dfn title="dom-appcache-DOWNLOADING"><code>DOWNLOADING</code></dfn>
@@ -39777,7 +39776,7 @@
 
    <dd><p>The <code>ApplicationCache</code> object is associated with
    an <span>application cache</span> whose group is in the
-   <i>downloading</i> <span title="concept-appcache-states">update
+   <i>downloading</i> <span title="concept-appcache-status">update
    status</span>.</p></dd>
 
    <dt><dfn title="dom-appcache-UPDATEREADY"><code>UPDATEREADY</code></dfn>
@@ -39785,11 +39784,19 @@
 
    <dd><p>The <code>ApplicationCache</code> object is associated with
    an <span>application cache</span> whose group is in the <i>idle</i>
-   <span title="concept-appcache-states">update status</span>, but
-   that application cache is <em>not</em> the newest cache in its
-   group that contains a resource categorized as a <span
-   title="concept-appcache-manifest">manifest</span>.</p></dd>
+   <span title="concept-appcache-status">update status</span> and the
+   <i>mature</i> <span title="concept-appcache-lifecycle">lifecycle
+   status</span> but that application cache is <em>not</em> the newest
+   cache in its group.</p></dd>
 
+   <dt><dfn title="dom-appcache-OBSOLETE"><code>OBSOLETE</code></dfn>
+   (numeric value 5)</dt>
+
+   <dd><p>The <code>ApplicationCache</code> object is associated with
+   an <span>application cache</span> whose group is in the
+   <i>obsolete</i> <span title="concept-appcache-lifecycle">lifecycle
+   status</span>.</p></dd>
+
   </dl>
 
   <p>The <dfn title="dom-appcache-length"><code>length</code></dfn>
@@ -39935,11 +39942,18 @@
    associated. (By definition, this is the same as the one that was
    found in the previous step.)</p></li>
 
-   <li><p>Check that there is an application cache in the same group
-   as <var title="">cache</var> which has an entry categorized as a
-   <span title="concept-appcache-manifest">manifest</span> that has is
-   newer than <var title="">cache</var>. If there is not, then raise
-   an <code>INVALID_STATE_ERR</code> exception and abort these
+   <li><p>If the group of <span title="application cache">application
+   caches</span> to which <var title="">cache</var> belongs has the
+   <span title="concept-appcache-lifecycle">lifecycle status</span>
+   <i>obsolete</i>, unassociate <var title="">document</var> from <var
+   title="">cache</var> and abort these steps.</p></li>
+
+   <li><p>Otherwise, check that there is an application cache in the
+   same group as <var title="">cache</var> which has an entry
+   categorized as a <span
+   title="concept-appcache-manifest">manifest</span> that is newer
+   than <var title="">cache</var>. If there is not, then raise an
+   <code>INVALID_STATE_ERR</code> exception and abort these
    steps.</p></li>
 
    <li><p>Let <var title="">new cache</var> be the newest
@@ -40009,6 +40023,13 @@
    title="event-cached">cached</code> event is targeted at or bubbles
    through the <code>ApplicationCache</code> object.</p></dd>
 
+
+   <dt><dfn title="handler-appcache-onobsolete"><code>onobsolete</code></dfn></dt>
+
+   <dd><p>Must be invoked whenever an <code
+   title="event-obsolete">obsolete</code> event is targeted at or bubbles
+   through the <code>ApplicationCache</code> object.</p></dd>
+
   </dl>
 
 




More information about the Commit-Watchers mailing list