[html5] r1599 - /

whatwg at whatwg.org whatwg at whatwg.org
Mon May 12 19:26:26 PDT 2008


Author: ianh
Date: 2008-05-12 19:26:25 -0700 (Mon, 12 May 2008)
New Revision: 1599

Modified:
   index
   source
Log:
[w] (2) Define what to do when you get a new implicit entry to add but the cache is up to date. Rejig some of the behaviour around to be slightly safer (and to prevent the cache update process from being invoked from withint the cache update process).

Modified: index
===================================================================
--- index	2008-05-13 01:41:18 UTC (rev 1598)
+++ index	2008-05-13 02:26:25 UTC (rev 1599)
@@ -30062,16 +30062,36 @@
      title=concept-appcache-upgrade>upgrade attempt</a> and the newly
      downloaded <var title="">manifest</var> is byte-for-byte identical to
      the manifest found in <var title="">cache</var>, or if the server
-     reported it as "304 Not Modified" or equivalent, then <a
-     href="#firing2">fire a simple event</a> called <code
-     title=event-noupdate>noupdate</code> at the <code><a
-     href="#applicationcache">ApplicationCache</a></code> singleton of each
-     <a href="#top-level">top-level browsing context</a> that 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 up to date. Then, jump to
-     the last step of the update process.
+     reported it as "304 Not Modified" or equivalent, then run these
+     substeps:</p>
 
+    <ol>
+     <li><a href="#firing2">Fire a simple event</a> called <code
+      title=event-noupdate>noupdate</code> at the <code><a
+      href="#applicationcache">ApplicationCache</a></code> singleton of each
+      <a href="#top-level">top-level browsing context</a> that 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 up to date.
+
+     <li>
+      <p>If there are any pending downloads of <span title="implicit
+       entry">implicit entries</span> that are being stored in the cache,
+       then wait for all of them to have completed. If any of these downloads
+       fail (e.g. the server returns a 4xx or 5xx response or equivalent, or
+       there is a DNS error, or the connection times out, or the user cancels
+       the download), then run the <a href="#cache0">cache failure steps</a>.
+
+     <li>
+      <p>Let the <a href="#update0" title=concept-appcache-status>status</a>
+       of the group of caches to which <var title="">cache</var> belongs be
+       <i>idle</i>. If appropriate, remove any user interface indicating that
+       an update for this cache is in progress.
+
+     <li>
+      <p>Abort the update process.
+    </ol>
+
    <li>
     <p>Set the <a href="#update0" title=concept-appcache-status>status</a> of
      <var title="">cache group</var> to <i>downloading</i>.
@@ -30215,21 +30235,6 @@
     </ol>
 
    <li>
-    <p>Wait for all pending downloads of <span title="implicit
-     entry">implicit entries</span> that are being stored in the cache to
-     have completed.</p>
-
-    <p class=example>For example, if the <a href="#top-level">top-level
-     browsing context</a>'s <a href="#active">active document</a> isn't
-     itself listed in the cache manifest, then it might still be being
-     downloaded.</p>
-
-    <p>If any of these downloads fail (e.g. the server returns a 4xx or 5xx
-     response or equivalent, or there is a DNS error, or the connection times
-     out, or the user cancels the download), then run the <a
-     href="#cache0">cache failure steps</a>.</p>
-
-   <li>
     <p>Store <var title="">manifest</var> in <var title="">new cache</var>,
      if it's not there already, and categorise this entry (whether newly
      added or not) as <a href="#the-manifest"
@@ -30248,12 +30253,24 @@
      cache.
 
    <li>
+    <p>Wait for all pending downloads of <span title="implicit
+     entry">implicit entries</span> that are being stored in the cache to
+     have completed.</p>
+
+    <p class=example>For example, if the <a href="#top-level">top-level
+     browsing context</a>'s <a href="#active">active document</a> isn't
+     itself listed in the cache manifest, then it might still be being
+     downloaded.</p>
+
+    <p>If any of these downloads fail (e.g. the server returns a 4xx or 5xx
+     response or equivalent, or there is a DNS error, or the connection times
+     out, or the user cancels the download), then run the <a
+     href="#cache0">cache failure steps</a>.</p>
+
+   <li>
     <p>If this is a <a href="#cache" title=concept-appcache-cache>cache
      attempt</a>, then:</p>
 
-    <p>Set the <a href="#update0" title=concept-appcache-status>status</a> of
-     <var title="">cache group</var> to <i>idle</i>.</p>
-
     <p id=flagAsCandidateForCache-result>Associate any <code>Document</code>
      objects that were <a href="#flagAsCandidateForCache">flagged as
      candidates</a> for this manifest URI's caches with <var
@@ -30268,13 +30285,13 @@
      indicating to the user that the application has been cached and that
      they can now use it offline.</p>
 
+    <p>Set the <a href="#update0" title=concept-appcache-status>status</a> of
+     <var title="">cache group</var> to <i>idle</i>.</p>
+
    <li>
     <p>Otherwise, this is an <a href="#upgrade"
      title=concept-appcache-upgrade>upgrade attempt</a>:</p>
 
-    <p>Set the <a href="#update0" title=concept-appcache-status>status</a> of
-     <var title="">cache group</var> to <i>idle</i>.</p>
-
     <p><a href="#firing2">Fire a simple event</a> called <code
      title=event-updateready>updateready</code> at the <code><a
      href="#applicationcache">ApplicationCache</a></code> singleton of each
@@ -30284,15 +30301,8 @@
      indicating to the user that a new version is available and that they can
      activate it by reloading the page.</p>
 
-   <li>
-    <p>Abort these steps. The following step is jumped to by various parts of
-     the algorithm above when they have to cancel the update.
-
-   <li>
-    <p>Let the <a href="#update0" title=concept-appcache-status>status</a> of
-     the group of caches to which <var title="">cache</var> belongs be
-     <i>idle</i>. If appropriate, remove any user interface indicating that
-     an update for this cache is in progress.
+    <p>Set the <a href="#update0" title=concept-appcache-status>status</a> of
+     <var title="">cache group</var> to <i>idle</i>.</p>
   </ol>
 
   <p>The <dfn id=cache0>cache failure steps</dfn> are as follows:

Modified: source
===================================================================
--- source	2008-05-13 01:41:18 UTC (rev 1598)
+++ source	2008-05-13 02:26:25 UTC (rev 1599)
@@ -27917,19 +27917,45 @@
 
    </li>
 
-   <li><p>If this is an <span title="concept-appcache-upgrade">upgrade
-   attempt</span> and the newly downloaded <var
-   title="">manifest</var> is byte-for-byte identical to the manifest
-   found in <var title="">cache</var>, or if the server reported it as
-   "304 Not Modified" or equivalent, then <span>fire a simple
-   event</span> called <code title="event-noupdate">noupdate</code> at
-   the <code>ApplicationCache</code> singleton of each <span>top-level
-   browsing context</span> that 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 up to date. Then, jump to the last
-   step of the update process.</p></li>
+   <li>
 
+    <p>If this is an <span title="concept-appcache-upgrade">upgrade
+    attempt</span> and the newly downloaded <var
+    title="">manifest</var> is byte-for-byte identical to the manifest
+    found in <var title="">cache</var>, or if the server reported it
+    as "304 Not Modified" or equivalent, then run these substeps:</p>
+
+    <ol>
+
+     <li><span>Fire a simple event</span> called <code
+     title="event-noupdate">noupdate</code> at the
+     <code>ApplicationCache</code> singleton of each <span>top-level
+     browsing context</span> that 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 up to date.</p></li>
+
+     <li><p>If there are any pending downloads of <span
+     title="implicit entry">implicit entries</span> that are being
+     stored in the cache, then wait for all of them to have
+     completed. If any of these downloads fail (e.g. the server
+     returns a 4xx or 5xx response or equivalent, or there is a DNS
+     error, or the connection times out, or the user cancels the
+     download), then run the <span>cache failure
+     steps</span>.</p></li>
+
+     <li><p>Let the <span
+     title="concept-appcache-status">status</span> of the group of
+     caches to which <var title="">cache</var> belongs be
+     <i>idle</i>. If appropriate, remove any user interface indicating
+     that an update for this cache is in progress.</p></li>
+
+     <li><p>Abort the update process.</p></li>
+
+    </ol>
+
+   </li>
+
    <li><p>Set the <span title="concept-appcache-status">status</span>
    of <var title="">cache group</var> to <i>downloading</i>.</p></li>
 
@@ -28065,6 +28091,21 @@
 
    </li>
 
+   <li><p>Store <var title="">manifest</var> in <var title="">new
+   cache</var>, if it's not there already, and categorise 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-oppcache-ns">opportunistic caching
+   namespaces</span>, and the URIs of the <span
+   title="concept-appcache-fallback">fallback entries</span> that they
+   map to, in the new cache.</p></li>
+
+   <li><p>Store the URIs that form the new <span
+   title="concept-appcache-onlinewhitelist">online whitelist</span> in
+   the new cache.</p></li>
+
    <li>
 
     <p>Wait for all pending downloads of <span title="implicit
@@ -28083,29 +28124,11 @@
 
    </li>
 
-   <li><p>Store <var title="">manifest</var> in <var title="">new
-   cache</var>, if it's not there already, and categorise 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-oppcache-ns">opportunistic caching
-   namespaces</span>, and the URIs of the <span
-   title="concept-appcache-fallback">fallback entries</span> that they
-   map to, in the new cache.</p></li>
-
-   <li><p>Store the URIs that form the new <span
-   title="concept-appcache-onlinewhitelist">online whitelist</span> in
-   the new cache.</p></li>
-
    <li>
 
     <p>If this is a <span title="concept-appcache-cache">cache
     attempt</span>, then:</p>
 
-    <p>Set the <span title="concept-appcache-status">status</span> of
-    <var title="">cache group</var> to <i>idle</i>.</p>
-
     <p id="flagAsCandidateForCache-result">Associate any
     <code>Document</code> objects that were <a
     href="#flagAsCandidateForCache">flagged as candidates</a> for this
@@ -28120,6 +28143,9 @@
     the user that the application has been cached and that they can
     now use it offline.</p>
 
+    <p>Set the <span title="concept-appcache-status">status</span> of
+    <var title="">cache group</var> to <i>idle</i>.</p>
+
    </li>
 
    <li>
@@ -28127,9 +28153,6 @@
     <p>Otherwise, this is an <span
     title="concept-appcache-upgrade">upgrade attempt</span>:</p>
 
-    <p>Set the <span title="concept-appcache-status">status</span> of
-    <var title="">cache group</var> to <i>idle</i>.</p>
-
     <p><span>Fire a simple event</span> called <code
     title="event-updateready">updateready</code> at the
     <code>ApplicationCache</code> singleton of each <span>top-level
@@ -28139,20 +28162,13 @@
     the user that a new version is available and that they can
     activate it by reloading the page.</p>
 
+    <p>Set the <span title="concept-appcache-status">status</span> of
+    <var title="">cache group</var> to <i>idle</i>.</p>
+
    </li>
 
-   <li><p>Abort these steps. The following step is jumped to by
-   various parts of the algorithm above when they have to cancel the
-   update.</p></li>
-
-   <li><p>Let the <span title="concept-appcache-status">status</span>
-   of the group of caches to which <var title="">cache</var> belongs
-   be <i>idle</i>. If appropriate, remove any user interface
-   indicating that an update for this cache is in progress.</p></li>
-
   </ol>
 
-
   <p>The <dfn>cache failure steps</dfn> are as follows:</p>
 
   <ol>




More information about the Commit-Watchers mailing list