HTML Standard Tracker

Filter

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
@@ -38385,35 +38385,31 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   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
   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>
 
-  <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>
 
   <ul>
 
    <li>
 
     <p>One of more resources (including their out-of-band metadata,
     such as HTTP headers, if any), identified by URLs, each falling
     into one (or more) of the following categories:</p>
@@ -39002,26 +38998,26 @@ style/default.css</pre>
     from its manifest (i.e. this update is an attempt to download the
     application for the first time). It also can't have any browsing
     contexts associated with it.</p>
 
    </li>
 
    <li>
 
     <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>
 
    <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
@@ -39054,25 +39050,26 @@ style/default.css</pre>
     <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><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
      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>
 
@@ -39086,25 +39083,26 @@ style/default.css</pre>
 
     </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>
 
    <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
    created <span>application cache</span> identified by <span
    title="">manifest URL</span>, being a new version in <var
    title="">cache group</var>. Otherwise, let <var title="">new
    cache</var> and <var title="">cache</var> be the same version of
    the application cache.</p></li>
 
    <li><p>Let <var title="">file list</var> be an empty list of
@@ -39139,27 +39137,27 @@ style/default.css</pre>
    <li>
 
     <p>For each URL in <var title="">file list</var>, run the
     following steps. These steps may be run in parallel for two or
     more of the URLs at a time.</p>
 
     <ol>
 
      <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>
 
       <p><span>Fetch</span> the resource. If this is an <span
       title="concept-appcache-upgrade">upgrade attempt</span>, then
       use <var title="">cache</var> as an HTTP cache, and honor HTTP
       caching semantics (such as expiration, ETags, and so forth) with
       respect to that cache. User agents may also have other caches in
       place that are also honored.</p>
 
@@ -39213,20 +39211,27 @@ style/default.css</pre>
      <li><p>If the URL being processed was flagged as an "implicit
      entry" in <var title="">file list</var>, then categorize the
      entry as a <span title="concept-appcache-implicit">implicit
      entry</span>.</p></li>
 
      <li><p>If the URL being processed was flagged as an "dynamic
      entry" in <var title="">file list</var>, then categorize the
      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>
 
    <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
@@ -39238,21 +39243,21 @@ style/default.css</pre>
    <li><p>Store the URLs 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
     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>
 
     <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. -->
 
@@ -39263,65 +39268,65 @@ style/default.css</pre>
     <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
     href="#flagAsCandidateForCache">flagged as candidates</a> for this
     manifest URL's caches with <var title="">cache</var>.</p>
 
     <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>
 
    </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
-    <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>
 
    </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>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
    the update process.</p></li>
 
    <li><p>Otherwise, 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. Abort the update
@@ -39370,38 +39375,28 @@ style/default.css</pre>
 
   <p>When the <dfn
   title="concept-appcache-init-with-attribute">application cache
   selection algorithm</dfn> algorithm is invoked with a manifest URL,
   the user agent must run the first applicable set of steps from the
   following list:</p>
 
   <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>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>
-
+    <p>Do nothing.</p>
    </dd>
 
-   <!-- otherwise, we're talking top-level browsing contexts only: -->
+
+   <!-- 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>
    </dd>
 
@@ -39496,35 +39491,68 @@ style/default.css</pre>
     <p>Invoke the <span
     title="concept-appcache-init-no-attribute">application cache
     selection algorithm</span> again, but without a manifest.</p>
    </dd>
 
   </dl>
 
   <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>
 
    <li><p>If the resource is not to be fetched using the HTTP GET
    mechanism or equivalent, then <span>fetch</span> the resource
    normally and abort these steps.</p></li>
 
    <li><p>If the resource's URL is <span
    title="concept-appcache-implicit">an implicit entry</span>, <span
    title="concept-appcache-manifest">the manifest</span>, <span
@@ -40500,27 +40528,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, 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
     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>
 
@@ -40557,27 +40584,26 @@ user reload must be equivalent to .reload()
    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 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>
     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>
 

|