HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2344

File a bug

SVNBugCommentTime (UTC)
2344[Gecko] [Webkit] [Google Gears] Make application caches work at the iframe level as well, not just whole-window level. This allows <iframe>s to contain gadgets from other hosts that are themselves cached.2008-10-16 01:39
Index: source
===================================================================
--- source	(revision 2343)
+++ source	(revision 2344)
@@ -38392,21 +38392,17 @@
   which is one of the following: <i>idle</i>, <i>checking</i>,
   <i>downloading</i>.</p>
 
-  <p id="appcache-history-1">A <span>browsing context</span> can be
-  associated with an application cache. A <span>child browsing
-  context</span> is always associated with the same application cache
-  as its <span>parent browsing context</span>, if any. A
-  <span>top-level browsing context</span> is associated with the
-  application cache appropriate for its <span>active
-  document</span>. (A browsing context's associated cache thus can <a
-  href="#appcache-history-2">change</a> during <span title="traverse
-  the history">session history traversal</span>.)</p>
-
-  <p>A <code>Document</code> initially has no appropriate cache, but
-  steps <a href="#parser-appcache">in the parser</a> and in the <span
+  <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.</p>
+  to occur early in the page load process. A browsing context's
+  associated cache can also <a href="#appcache-history-2">change</a>
+  during <span title="traverse the history">session history
+  traversal</span>.</p>
 
   <p>An application cache consists of:</p>
 
@@ -39009,12 +39005,12 @@
 
     <p><span>Fire a simple event</span> called <code
     title="event-checking">checking</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 user agent is checking for the availability of
-    updates.</p>
+    <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>
 
    </li>
 
@@ -39061,11 +39057,12 @@
 
      <li><p><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>
+     <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 up to
+     date.</p></li>
 
      <li><p>If there are any pending downloads of <span
      title="implicit entry">implicit entries</span> that are being
@@ -39093,11 +39090,12 @@
 
    <li><p><span>Fire a simple event</span> called <code
    title="event-downloading">downloading</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 a new version is being downloaded.</p></li>
+   <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 a new version is being
+   downloaded.</p></li>
 
    <li><p>If this is an <span title="concept-appcache-upgrade">upgrade
    attempt</span>, then let <var title="">new cache</var> be a newly
@@ -39146,13 +39144,13 @@
 
      <li><p><span>Fire a simple event</span> called <code
      title="event-progress">progress</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 a file is being downloaded in preparation for
-     updating the application.</p></li> <!-- XXX need to include
-     progress information -->
+     <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 a file is being downloaded
+     in preparation for updating the application.</p></li> <!-- XXX
+     need to include progress information -->
 
      <li>
 
@@ -39220,6 +39218,13 @@
      entry as a <span title="concept-appcache-dynamic">dynamic
      entry</span>.</p></li>
 
+     <li><p>As an optimization, if the resource is an HTML or XML file
+     whose root element is an <code>html</code> element with a <code
+     title="attr-html-manifest">manifest</code> attribute whose value
+     doesn't match the manifest URL of the application cache being
+     processed, then the user agent should mark the entry as being
+     <span title="concept-appcache-foreign">foreign</span>.</p>
+
     </ol>
 
    </li>
@@ -39245,7 +39250,7 @@
     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
+    <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
     downloaded.</p>
@@ -39270,12 +39275,12 @@
 
     <p><span>Fire a simple event</span> called <code
     title="event-cached">cached</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 has been cached and that they can
-    now use it offline.</p>
+    <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>
@@ -39289,12 +39294,12 @@
 
     <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
-    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 a new version is available and that they can
-    activate it by reloading the page.</p>
+    <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 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>
@@ -39309,12 +39314,12 @@
 
    <li><p><span>Fire a simple event</span> called <code
    title="event-error">error</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 user agent failed to save the application for offline
-   use.</p></li>
+   <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 failed to save the
+   application for offline use.</p></li>
 
    <li><p>If this is a <span title="concept-appcache-cache">cache
    attempt</span>, then discard <var title="">cache</var> and abort
@@ -39377,25 +39382,15 @@
   <dl class="switch">
 
    <dt>If the resource is not being loaded as part of navigation of a
-   <span>top-level browsing context</span></dt>
+   <span>browsing context</span></dt>
 
    <dd>
+    <p>Do nothing.</p>
+   </dd>
 
-    <p>As an optimization, if the resource was loaded from an
-    <span>application cache</span>, and the manifest URL of that cache
-    doesn't match the manifest URL with which the algorithm was
-    invoked, then the user agent should mark the entry in that
-    application cache corresponding to the resource that was just
-    loaded as being <span
-    title="concept-appcache-foreign">foreign</span>.</p>
 
-    <p>Other than that, nothing special happens with respect to
-    application caches.</p>
+   <!-- otherwise, we're talking browsing contexts only: -->
 
-   </dd>
-
-   <!-- otherwise, we're talking top-level 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>
@@ -39503,21 +39498,54 @@
   <p>When the <dfn
   title="concept-appcache-init-no-attribute">application cache
   selection algorithm</dfn> is invoked <em>without</em> a manifest,
-  then: if the resource is being loaded as part of navigation of a
-  <span>top-level browsing context</span>, and the resource was
-  fetched from a particular <span>application cache</span>, then 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; otherwise, nothing special happens
-  with respect to application caches.</p>
+  then the user agent must run the first applicable set of steps from
+  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>
+
+    <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.
+
+   </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 -->
+
+    <p>The user agent must associate the <code>Document</code> with
+    that application cache associated with the <span>active
+    document</span> of the <span>parent browsing context</span>.</p>
+
+   </dd>
+
+   <dt>Otherwise</dt>
+
+   <dd>
+
+    <p>Nothing special happens with respect to application caches.</p>
+
+   </dd>
+
+  </dl>
+
+
+
   <h5 id="changesToNetworkingModel">Changes to the networking model</h5>
 
-  <p>When a browsing context is associated with an <span>application
-  cache</span>, any and all resource loads must go through the
-  following steps instead of immediately invoking the mechanisms
-  appropriate to that resource's scheme:</p>
+  <p>When a <span>browsing context</span> is associated with an
+  <span>application cache</span>, any and all resource loads must go
+  through the following steps instead of immediately invoking the
+  mechanisms appropriate to that resource's scheme:</p>
 
   <ol>
 
@@ -40507,13 +40535,12 @@
    <li>
 
     <p>If the new resource is to be fetched using HTTP GET or
-    equivalent, and if the browsing context being navigated is a
-    <span>top-level browsing context</span>, 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
+    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
     user agent must then get the resource from the <span
@@ -40564,13 +40591,12 @@
     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> <!-- 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 -->
+    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>

|