HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2339[Gecko] [Webkit] [Google Gears] handle captive portals better in the offline appcache feature2008-10-16 00:45
@@ -39184,24 +39184,37 @@ style/default.css</pre>
       be being downloaded is a large image on a Web page that is being
       seen for the first time. The image would get downloaded to
       satisfy the <code>img</code> element on the page, as well as
       being listed in the cache manifest. According to the rules for
       <span title="fetch">fetching</span> that image only need be
       downloaded once, and it can be used both for the cache and for
       the rendered Web page.</p>
 
      </li>
 
-     <li><p>If the previous steps 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), then run
-     the <span>cache failure steps</span>.</p></li>
+     <li>
+
+      <p>If the previous steps 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 if
+      the server returned a redirect, then run the <span>cache failure
+      steps</span>.</p>
+
+      <p class="note">Redirects are fatal because they are either
+      indicative of a network problem (e.g. a captive portal); or
+      would allow resources to be added to the cache under URLs that
+      differ from any URL that the networking model will allow access
+      to, leaving orphan entries; or would allow resources to be
+      stored under URLs different than their true URLs. All of these
+      situations are bad.</p>
+
+     </li>
 
      <li><p>Otherwise, the fetching succeeded. Store the resource in
      the <var title="">new cache</var>.</p></li>
 
      <li><p>If the URL being processed was flagged as an "explicit
      entry" in <var title="">file list</var>, then categorize the
      entry as an <span title="concept-appcache-explicit">explicit
      entry</span>.</p></li>
 
      <li><p>If the URL being processed was flagged as a "fallback
@@ -39242,24 +39255,25 @@ style/default.css</pre>
 
     <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 <span>top-level browsing
     context</span>'s <span>active document</span> 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 <span>cache failure steps</span>.</p>
+    <p>If any of these downloads fail (e.g. the connection times out,
+    or the user cancels the download), then run the <span>cache
+    failure steps</span>.</p> <!-- can't fail with a non-2xx code,
+    because things only get added to the cache implicitly once they
+    are known to have a manifest="" attribute. -->
 
    </li>
 
    <li>
 
     <p>If this is a <span title="concept-appcache-cache">cache
     attempt</span>, then:</p>
 
     <p id="flagAsCandidateForCache-result">Associate any
     <code>Document</code> objects that were <a
@@ -39533,28 +39547,29 @@ style/default.css</pre>
 
    <li>
 
     <p>If the resource's URL has the <span>same origin</span> as the
     manifest's URL, and there is a <span
     title="concept-appcache-fallback-ns">fallback namespace</span> in
     the <span>application cache</span> whose &lt;path&gt; component is
     a <span>prefix match</span> for the resource's URL's <span
     title="url-path">&lt;path&gt;</span> component, then:</p>
 
-    <p><span>Fetch</span> the resource normally. If this results 4xx
-    or 5xx status codes or equivalent, or if there were network errors
-    (but not if the user canceled the download), then instead get,
-    from the cache, the resource of the <span
-    title="concept-appcache-fallback">fallback entry</span>
-    corresponding to the namespace with the longest matching <span
-    title="url-path">&lt;path&gt;</span> component. Abort these
-    steps.</p>
+    <p><span>Fetch</span> the resource normally. If this results in a
+    redirect to a resource with another <span>origin</span>
+    (indicative of a captive portal), or a 4xx or 5xx status code or
+    equivalent, or if there were network errors (but not if the user
+    canceled the download), then instead get, from the cache, the
+    resource of the <span title="concept-appcache-fallback">fallback
+    entry</span> corresponding to the namespace with the longest
+    matching <span title="url-path">&lt;path&gt;</span>
+    component. Abort these steps.</p>
 
    </li>
 
    <li><p>If there is an entry in the <span>application cache</span>'s
    <span title="concept-appcache-onlinewhitelist">online
    whitelist</span> that has the <span>same origin</span> as the
    resource's URL and that is a <span>prefix match</span> for the
    resource's URL, then <span>fetch</span> the resource normally and
    abort these steps.</p></li>
 
@@ -39726,23 +39741,23 @@ style/default.css</pre>
    <li><p>If <var title="">url</var> has a different <span
    title="url-scheme">&lt;scheme&gt;</span> component than the
    manifest's URL, then raise a <span>security
    exception</span>.</p></li>
 
    <li><p>Return, but do not abort these steps.</p></li>
 
    <li><p><span>Fetch</span> the resource referenced by <var
    title="">url</var>.</p></li>
 
-   <li><p>If this results 4xx or 5xx status codes or equivalent, or if
-   there were network errors, or if the user canceled the download,
-   then abort these steps.</p></li>
+   <li><p>If this results in a redirect, or a 4xx or 5xx status code
+   or equivalent, or if there were network errors, or if the user
+   canceled the download, then abort these steps.</p></li>
 
    <li>
 
     <p>Wait for there to be no running scripts, or at least no running
     scripts that can reach an <code>ApplicationCache</code> object
     associated with the <span>application cache</span> with which this
     <code>ApplicationCache</code> object is associated.</p>
 
     <p>Add the fetched resource to the <span>application cache</span>
     and categorize it as a <span
@@ -40557,21 +40572,24 @@ user reload must be equivalent to .reload()
 
     <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 browsing context being navigated is a <span>top-level browsing
     context</span>, 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>
+    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>
 

|