HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2346[Gecko] [Webkit] [Google Gears] Appcache: Fix a number of race conditions; introduce the concept of the cache lifecycle, allowing caches to be obsoleted; fire checking and downloading events on ApplicationCache objects that join an update process already in progress.2008-10-16 10:32
@@ -38380,24 +38380,37 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   <p>An <dfn>application cache</dfn> is a collection of resources. An
   application cache is identified by the <span>absolute URL</span> of
   a resource manifest which is used to populate the cache.</p>
 
   <p>Application caches are versioned, and there can be different
   instances of caches for the same manifest URL, each having a
   different version. A cache is newer than another if it was created
   after the other (in other words, caches in a group have a
   chronological order).</p>
 
-  <p>Each group of application caches for the same manifest URL have a
+  <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>.</p>
+  <i>downloading</i>. Initially, the <span
+  title="concept-appcache-status">update status</span> of a group of
+  application caches is <i>idle</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
+  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
   associated with the application cache appropriate for its
   <span>active document</span>, if any. A <code>Document</code>
   initially has no appropriate cache, but steps <a
   href="#parser-appcache">in the parser</a> and in the <span
   title="navigate">navigation</span> sections cause <span
   title="concept-appcache-init-with-attribute">cache selection</span>
   to occur early in the page load process. A browsing context's
   associated cache can also <a href="#appcache-history-2">change</a>
@@ -38478,21 +38491,22 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
 
    <li>Zero or more URLs that form the <dfn
    title="concept-appcache-onlinewhitelist">online whitelist
    namespaces</dfn>.
 
   </ul>
 
   <p>Multiple application caches can contain the same resource,
   e.g. if their manifests all reference that resource. If the user
   agent is to <dfn title="concept-appcache-selection">select an
-  application cache</dfn> from a list of caches that contain a
+  application cache</dfn> from a list of <span title="relevant
+  application cache">relevant application caches</span> that contain a
   resource, that the user agent must use the application cache that
   the user most likely wants to see the resource from, taking into
   account the following:</p>
 
   <ul>
 
    <li>which application cache was most recently updated,
 
    <li>which application cache was being used to display the
    resource from which the user decided to look at the new resource,
@@ -38941,52 +38955,108 @@ style/default.css</pre>
   matches an entry in the online whitelist, or if a resource matches
   both an entry in the fallback section and the online whitelist, the
   resource will taken from the cache, and the online whitelist entry
   will be ignored.</p>
 
 
   <h4>Updating an application cache</h4>
 
   <p>When the user agent is required (by other parts of this
   specification) to start the <dfn>application cache update
-  process</dfn>, the user agent must run the following steps:</p>
+  process</dfn> for a <span
+  title="concept-appcache-manifest">manifest</span> URL or for an
+  <span>application cache</span>, potentially given a particular
+  <span>browsing context</span>, and potentially given a new <span
+  title="concept-appcache-master">master</span> resource, the user
+  agent must run the following steps:</p>
 
   <p class="XXX">the event stuff needs to be more consistent --
   something about showing every step of the ui or no steps or
   something; and we need to deal with showing ui for browsing contexts
   that open when an update is already in progress, and we may need to
   give applications control over the ui the first time they cache
   themselves (right now the original cache is done without
-  notifications to the browsing contexts)</p>
+  notifications to the browsing contexts); also, we need to update
+  this so all event firing uses queues</p>
 
   <ol>
 
-   <li><p>Let <var title="">manifest URL</var> be the URL of the <span
-   title="concept-appcache-manifest">manifest</span> of the cache to
-   be updated.</p></li>
+   <li>
+
+    <p>Atomically, so as to avoid race conditions, perform the
+    following substeps:</p>
+
+    <ol>
+
+     <li><p>Let <var title="">manifest URL</var> be the URL of the
+     <span title="concept-appcache-manifest">manifest</span> to be
+     updated, or of the <span
+     title="concept-appcache-manifest">manifest</span> of the
+     <span>application cache</span> to be updated, as
+     appropriate.</p></li>
+
+     <li><p>If these steps were invoked with a URL (as opposed to a
+     specific cache), and there is no <span>application cache</span>
+     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>
+
+     <li id="flagAsCandidateForCache"><p>If these steps were invoked
+     with a new <span title="concept-appcache-master">master</span>
+     resource, then flag the resource's <code>Document</code> as a
+     candidate for this manifest URL's caches, so that it will be <a
+     href="#flagAsCandidateForCache-result">associated with an
+     application cache identified by this manifest URL</a> later, when
+     such an <span>application cache</span> is ready.</p></li>
+
+     <li><p>Let <var title="">cache group</var> be the group of <span
+     title="application cache">application caches</span> identified by
+     <var title="">manifest URL</var>.</p></li>
+
+     <li><p>Let <var title="">cache</var> be the most recently updated
+     <span>application cache</span> identified by <var title="">manifest
+     URL</var> (that is, the newest version found in <var title="">cache
+     group</var>).</p></li>
+
+     <li><p>If these steps were invoked with a <span>browsing
+     context</span>, and the <span
+     title="concept-appcache-status">status</span> of the <var
+     title="">cache group</var> is <i>checking</i> or
+     <i>downloading</i>, then <span>fire a simple event</span> called
+     <code title="event-checking">checking</code> at the
+     <code>ApplicationCache</code> singleton of that <span>browsing
+     context</span>.</p></li>
+
+     <li><p>If these steps were invoked with a <span>browsing
+     context</span>, and the <span
+     title="concept-appcache-status">status</span> of the <var
+     title="">cache group</var> is <i>downloading</i>, then also
+     <span>fire a simple event</span> called <code
+     title="event-downloading">downloading</code> at the
+     <code>ApplicationCache</code> singleton of that <span>browsing
+     context</span>.</p></li>
+
+     <li><p>If the <span title="concept-appcache-status">status</span>
+     of the <var title="">cache group</var> is either <i>checking</i>
+     or <i>downloading</i>, then abort this instance of the update
+     process, as an update is already in progress for them.</p></li>
+
+     <li><p>Set the <span
+     title="concept-appcache-status">status</span> of this group of
+     caches to <i>checking</i>.</p>
 
-   <li><p>Let <var title="">cache group</var> be the group of <span
-   title="application cache">application caches</span> identified by
-   <var title="">manifest URL</var>.</p></li>
+    </ol>
 
-   <li><p>Let <var title="">cache</var> be the most recently updated
-   <span>application cache</span> identified by <var title="">manifest
-   URL</var> (that is, the newest version found in <var title="">cache
-   group</var>).</p></li>
+    <p>The remainder of the steps run asychronously.</p>
 
-   <li><p>If the <span title="concept-appcache-status">status</span>
-   of the <var title="">cache group</var> is either <i>checking</i> or
-   <i>downloading</i>, then abort these steps, as an update is already
-   in progress for them. Otherwise, set the <span
-   title="concept-appcache-status">status</span> of this group of
-   caches to <i>checking</i>. This entire step must be performed as
-   one atomic operation so as to avoid race conditions.</p></li>
+   </li>
 
    <li>
 
     <p>If there is already a resource with the URL of <var
     title="">manifest URL</var> in <var title="">cache</var>, and
     that resource is categorized as a <span
     title="concept-appcache-manifest">manifest</span>, then this is an
     <dfn title="concept-appcache-upgrade">upgrade
     attempt</dfn>. Otherwise, this is a <dfn
     title="concept-appcache-cache">cache attempt</dfn>.</p>
@@ -39005,20 +39075,27 @@ style/default.css</pre>
 
     <p><span>Fire a simple event</span> called <code
     title="event-checking">checking</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 user agent is checking
     for the availability of updates.</p>
 
+    <p class="note">Again, if this is a <span
+    title="concept-appcache-cache">cache attempt</span>, then <var
+    title="">cache group</var> has only one cache and it has no
+    browsing contexts associated with it, so no events are dispatched
+    due to this step or any of the other steps that fire events other
+    than the final <code title="event-cached">cached</code> event.</p>
+
    </li>
 
    <li>
 
     <p><span>Fetch</span> the resource from <var title="">manifest
     URL</var>, and let <var title="">manifest</var> be that
     resource.</p>
 
     <p>If the resource is labeled with the MIME type <code
     title="">text/cache-manifest</code>, parse <var
@@ -39028,27 +39105,30 @@ style/default.css</pre>
     <span title="concept-appcache-fallback">fallback entries</span>
     and the <span title="concept-appcache-fallback-ns">fallback
     namespaces</span> that map to them, and entries for the <span
     title="concept-appcache-onlinewhitelist">online
     whitelist</span>.</p>
 
    </li>
 
    <li>
 
-    <p>If the previous step fails (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, or the
-    parser for manifests fails when checking the magic signature), or
-    if the resource is labeled with a MIME type other than <code
-    title="">text/cache-manifest</code>, then run the <span>cache
-    failure steps</span>.</p>
+    <p>If the previous step fails due to a 404 or 410 response or
+    equivalent, then run the <span>cache removal steps</span></p>
+
+    <p>If the previous step fails in some other way (e.g. the server
+    returns another 4xx or 5xx response or equivalent, or there is a
+    DNS error, or the connection times out, or the user cancels the
+    download, or the parser for manifests fails when checking the
+    magic signature), or if the resource is labeled with a MIME type
+    other than <code title="">text/cache-manifest</code>, then run the
+    <span>cache failure steps</span>.</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>
@@ -39231,25 +39311,25 @@ style/default.css</pre>
 
    <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
    title="concept-appcache-fallback">fallback entries</span> that they
-   map to, in the new cache.</p></li>
+   map to, in <var title="">new cache</var>.</p></li>
 
    <li><p>Store the URLs that form the new <span
    title="concept-appcache-onlinewhitelist">online whitelist</span> in
-   the new cache.</p></li>
+   <var title="">new cache</var>.</p></li>
 
    <li>
 
     <p>Wait for all pending downloads of <span
     title="concept-appcache-master">master entries</span> that are
     being stored in the cache to have completed.</p>
 
     <p class="example">For example, if the <span>browsing
     context</span>'s <span>active document</span> isn't itself listed
     in the cache manifest, then it might still be being
@@ -39275,22 +39355,27 @@ style/default.css</pre>
 
     <p><span>Fire a simple event</span> called <code
     title="event-cached">cached</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 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>
+    <p>Set the <span title="concept-appcache-lifecycle">lifecycle
+    status</span> of <var title="">cache group</var> to
+    <i>mature</i>.</p>
+
+    <p>Set the <span title="concept-appcache-status">update
+    status</span> of <var title="">cache group</var> to
+    <i>idle</i>.</p>
 
    </li>
 
    <li>
 
     <p>Otherwise, this is an <span
     title="concept-appcache-upgrade">upgrade attempt</span>:</p>
 
     <p><span>Fire a simple event</span> called <code
     title="event-updateready">updateready</code> at the
@@ -39301,20 +39386,49 @@ style/default.css</pre>
     interface indicating to 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>
 
   </ol>
 
+  <p>The <dfn>cache removal steps</dfn> are as follows:</p>
+
+  <ol>
+
+   <li><p>If this is a <span title="concept-appcache-cache">cache
+   attempt</span>, then discard <var title="">cache</var> and abort
+   the update process.</p></li>
+
+   <li><p><span>Fire a simple event</span> called <code
+   title="event-error">error</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? -->
+
+   <li><p>Set the <span title="concept-appcache-lifecycle">lifecycle
+   status</span> of <var title="">cache group</var> to
+   <i>obsolete</i>.</p></li>
+
+   <li><p>Let the <span title="concept-appcache-status">update
+   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. Abort the update process.</p></li>
+
+  </ol>
+
   <p>The <dfn>cache failure steps</dfn> are as follows:</p>
 
   <ol>
 
    <li><p><span>Fire a simple event</span> called <code
    title="event-error">error</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
@@ -39337,27 +39451,26 @@ style/default.css</pre>
 
 
   <h4>Processing model</h4>
 
   <p>The processing model of application caches for offline support in
   Web applications is part of the <span
   title="navigate">navigation</span> model, but references the
   algorithms defined in this section.</p>
 
   <p>A URL <dfn title="concept-appcache-matches-fallback">matches a
-  fallback namespace</dfn> if there exists an <span>application
-  cache</span> whose <span
+  fallback namespace</dfn> if there exists a <span>relevant
+  application cache</span> whose <span
   title="concept-appcache-manifest">manifest</span>'s URL has the
-  <span>same origin</span> as the URL in question, and if that
-  application cache has a <span
-  title="concept-appcache-fallback-ns">fallback namespace</span> that
-  is a <span>prefix match</span> for the URL being examined. If
+  <span>same origin</span> as the URL in question, and that has a
+  <span title="concept-appcache-fallback-ns">fallback namespace</span>
+  that is a <span>prefix match</span> for the URL being examined. If
   multiple fallback namespaces match the same URL, the longest one is
   the one that matches. A URL looking for an fallback namespace can
   match more than one application cache at a time, but only matches
   one namespace in each cache.</p>
 
   <div class="example">
 
    <p>If a manifest <code
    title="">http://example.com/app1/manifest</code> declares that
    <code title="">http://example.com/resources/images</code> is a
@@ -39388,23 +39501,26 @@ style/default.css</pre>
     <p>Do nothing.</p>
    </dd>
 
 
    <!-- otherwise, we're talking browsing contexts only: -->
 
    <dt>If the resource being loaded was loaded from an application
    cache and the URL of that application cache's manifest is the
    same as the manifest URL with which the algorithm was invoked</dt>
    <dd>
+
     <p>Associate the <code>Document</code> with the cache from which
     it was loaded. Invoke the <span>application cache update
-    process</span>.</p>
+    process</span> for that cache and with the <span>browsing
+    context</span> being navigated.</p>
+
    </dd>
 
 
    <dt>If the resource being loaded was loaded from an application
    cache and the URL of that application cache's manifest is
    <em>not</em> the same as the manifest URL with which the algorithm
    was invoked</dt>
 
    <dd>
 
@@ -39436,57 +39552,25 @@ style/default.css</pre>
    <dd>
 
     <ol>
 
      <li><p>If the manifest URL does not have the <span>same
      origin</span> as the resource's own URL, then invoke the <span
      title="concept-appcache-init-no-attribute">application cache
      selection algorithm</span> again, but without a manifest, and
      abort these steps.</p></li>
 
-     <li><p>If there is already an <span>application cache</span>
-     identified by this manifest URL, and the most up to date version
-     of that <span>application cache</span> contains a resource with
-     the URL of the manifest, and that resource is categorized as a
-     <span title="concept-appcache-manifest">manifest</span>, then:
-     store the resource in the matching cache, categorized as an <span
-     title="concept-appcache-master">master entry</span>,
-     associate the <code>Document</code> with that cache, invoke the
-     <span>application cache update process</span>, and abort these
-     steps.</p></li>
-
-     <li id="flagAsCandidateForCache"><p>Flag the resource's
-     <code>Document</code> as a candidate for this manifest URL's
-     caches, so that it will be <a
-     href="#flagAsCandidateForCache-result">associated with an
-     application cache identified by this manifest URL</a> later, when
-     such an <span>application cache</span> is ready.</p></li>
-
-     <li><p>If there is already an <span>application cache</span>
-     identified by this manifest URL, then the most up to date version
-     of that <span>application cache</span> does not yet contain a
-     resource with the URL of the manifest, or it does but that
-     resource is not yet categorized as a <span
-     title="concept-appcache-manifest">manifest</span>: store the
-     resource in that cache, categorized as an <span
-     title="concept-appcache-master">master entry</span>
-     (replacing the file's previous contents if it was already in the
-     cache, but not removing any other categories it might have), and
-     abort these steps. (An <span>application cache update
-     process</span> is already in progress.)</p></li>
-
-     <li><p>Otherwise, there is no matching <span>application
-     cache</span>: create a new application cache identified by this
-     manifest URL, store the resource in that cache, categorized as an
-     <span title="concept-appcache-master">master entry</span>,
-     and then invoke the <span>application cache update
-     process</span>.</p></li>
+     <li><p>Otherwise, invoke the <span>application cache update
+     process</span> for the given manifest URL, with the
+     <span>browsing context</span> being navigated, and with the
+     resource's <code>Document</code> as the new master
+     resource.</p></li>
 
     </ol>
 
    </dd>
 
 
    <dt>Otherwise</dt>
    <dd>
     <p>Invoke the <span
     title="concept-appcache-init-no-attribute">application cache
@@ -39502,23 +39586,26 @@ style/default.css</pre>
   the following list:</p>
 
   <dl>
 
    <dt>If the resource is being loaded as part of navigation of a
    <span>browsing context</span>, and the resource was fetched from a
    particular <span>application cache</span></dt>
 
    <dd>
 
+    <!-- this can only happen for subframes -->
+
     <p>The user agent must associate the <code>Document</code> with
     that application cache and invoke the <span>application cache
-    update process</span> for that cache.
+    update process</span> for that cache, with that <span>browsing
+    context</span>.</p>
 
    </dd>
 
    <dt>If the resource is being loaded as part of navigation of a
    <span>child browsing context</span></dt>
 
    <dd>
 
     <!-- e.g. iframes to online whitelisted resources -->
 
@@ -39805,22 +39892,23 @@ style/default.css</pre>
   must be removed entirely (such that if it is re-added, it will be
   loaded from the network again). If the <code>ApplicationCache</code>
   object is not associated with any application cache, then the method
   must raise an <code>INVALID_STATE_ERR</code> exception instead.</p>
 
   <p>If the <dfn
   title="dom-appcache-update"><code>update()</code></dfn> method is
   invoked, the user agent must invoke the <span>application cache
   update process</span>, in the background, for the <span>application
   cache</span> with which the <code>ApplicationCache</code> object is
-  associated. If there is no such application cache, then the method
-  must raise an <code>INVALID_STATE_ERR</code> exception instead.</p>
+  associated, but with no <span>browsing context</span>. If there is
+  no such application cache, then the method must raise an
+  <code>INVALID_STATE_ERR</code> exception instead.</p>
 
   <p>If the <dfn
   title="dom-appcache-swapCache"><code>swapCache()</code></dfn> method
   is invoked, the user agent must run the following steps:
 
   <ol>
 
    <li><p>Let <var title="">document</var> be the
    <code>Document</code> with which the <code>ApplicationCache</code>
    object is associated.</p></li>
@@ -40272,21 +40360,21 @@ style/default.css</pre>
   <h4>The <code>Location</code> interface</h4>
 
   <p>Each <code>Document</code> object in a <span>browsing
   context</span>'s session history is associated with a unique
   instance of a <code>Location</code> object.</p>
 
   <p>The <dfn
   title="dom-document-location"><code>location</code></dfn> attribute
   of the <code>HTMLDocument</code> interface must return the
   <code>Location</code> object for that <code>Document</code> object,
-  if it is in a <span>browser context</span>, and null otherwise.</p>
+  if it is in a <span>browsing context</span>, and null otherwise.</p>
 
   <p>The <dfn title="dom-location"><code>location</code></dfn>
   attribute of the <code>Window</code> interface must return the
   <code>Location</code> object for that <code>Window</code> object's
   <span>active document</span>.</p>
 
   <p><code>Location</code> objects provide a representation of <span
   title="the document's address">their document's address</span>, and
   allow the <span>current entry</span> of the <span>browsing
   context</span>'s session history to be changed, by adding or
@@ -40528,28 +40616,26 @@ user reload must be equivalent to .reload()
 
    <li><p>If the new resource is to be handled using a mechanism that
    does not affect the browsing context, e.g. ignoring the navigation
    request altogether because the specified scheme is not one of the
    supported protocols, then abort these steps and proceed with that
    mechanism instead.</p></li>
 
    <li>
 
     <p>If the new resource is to be fetched using HTTP GET or
-    equivalent, then check if there are any <span title="application
-    cache">application caches</span> that have a <span
-    title="concept-appcache-manifest">manifest</span> with the
-    <span>same origin</span> as the URL in question, and that have
-    this URL as one of their entries, excluding entries marked as
-    <span title="concept-appcache-foreign">foreign</span>, and that
-    already contain their manifest, categorized as a <span
-    title="concept-appcache-manifest">manifest</span>. If so, then the
+    equivalent, then check if there are any <span title="relevant
+    application cache">relevant application caches</span> that are
+    identified by a URL with the <span>same origin</span> as the URL
+    in question, and that have this URL as one of their entries,
+    excluding entries marked as <span
+    title="concept-appcache-foreign">foreign</span>. If so, then the
     user agent must then get the resource from the <span
     title="concept-appcache-selection">most appropriate application
     cache</span> of those that match.</p>
 
     <p>Otherwise, <span>fetch</span> the new resource. If this results
     in a redirect, return to <a href="#navigate-fragid-step">the step
     labeled "fragment identifiers"</a> with the new resource.</p>
 
     <p class="example">For example, imagine an HTML page with an
     associated application cache displaying an image and a form, where
@@ -40582,28 +40668,29 @@ user reload must be equivalent to .reload()
    agent to establish that the resource in question is empty. During
    this time, the user agent may allow the user to cancel this
    navigation attempt or start other navigation attempts.</p></li>
 
    <li>
 
     <p>If the resource was not fetched from an <span>application
     cache</span>, and was to be fetched using HTTP GET or equivalent,
     and its URL <span
     title="concept-appcache-matches-fallback">matches the fallback
-    namespace</span> of one or more application caches, and the user
-    didn't cancel the navigation attempt during the previous step, and
-    the navigation attempt failed (e.g. the server returned a 4xx or
-    5xx status code or equivalent, or there was a DNS error),
-    then:</p> <!-- note that a redirect can never reach this point as
-    it is handled earlier, meaning that a captive portal captures URLs
-    in fallback namespaces and you can't ever get to the fallback file
-    of a resource if you have a captive portal -->
+    namespace</span> of one or more <span title="relevant application
+    cache">relevant application caches</span>, and the user didn't
+    cancel the navigation attempt during the previous step, and the
+    navigation attempt failed (e.g. the server returned a 4xx or 5xx
+    status code or equivalent, or there was a DNS error), then:</p>
+    <!-- note that a redirect can never reach this point as it is
+    handled earlier, meaning that a captive portal captures URLs in
+    fallback namespaces and you can't ever get to the fallback file of
+    a resource if you have a captive portal -->
 
     <p>Let <var title="">candidate</var> be the <span
     title="concept-appcache-fallback">fallback resource</span>
     specified for the <span
     title="concept-appcache-fallback-ns">fallback namespace</span> in
     question. If multiple application caches match, the user agent
     must use the fallback of the <span
     title="concept-appcache-selection">most appropriate application
     cache</span> of those that match.</p>
 

|