Permalink
Browse files

[gwr] (2) Make application caches work at the iframe level as well, n…

…ot just whole-window level. This allows <iframe>s to contain gadgets from other hosts that are themselves cached.

git-svn-id: http://svn.whatwg.org/webapps@2344 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent acfdd0a commit 2f54561cf942fe360b77e5bcceb5a45549097a8d @Hixie Hixie committed Oct 16, 2008
Showing with 232 additions and 180 deletions.
  1. +112 −86 index
  2. +120 −94 source
View
198 index
@@ -33837,18 +33837,14 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
which is one of the following: <i>idle</i>, <i>checking</i>,
<i>downloading</i>.</p>
- <p id=appcache-history-1>A <a href=#browsing-context>browsing context</a> can be
- associated with an application cache. A <a href=#child-browsing-context>child browsing
- context</a> is always associated with the same application cache
- as its <a href=#parent-browsing-context>parent browsing context</a>, if any. A
- <a href=#top-level-browsing-context>top-level browsing context</a> is associated with the
- application cache appropriate for its <a href=#active-document>active
- document</a>. (A browsing context's associated cache thus can <a href=#appcache-history-2>change</a> during <a href=#traverse-the-history title="traverse
- the history">session history traversal</a>.)</p>
-
- <p>A <code>Document</code> initially has no appropriate cache, but
- steps <a href=#parser-appcache>in the parser</a> and in the <a href=#navigate title=navigate>navigation</a> sections cause <a href=#concept-appcache-init-with-attribute title=concept-appcache-init-with-attribute>cache selection</a>
- to occur early in the page load process.</p>
+ <p id=appcache-history-1>A <a href=#browsing-context>browsing context</a> is
+ associated with the application cache appropriate for its
+ <a href=#active-document>active document</a>, if any. A <code>Document</code>
+ initially has no appropriate cache, but steps <a href=#parser-appcache>in the parser</a> and in the <a href=#navigate title=navigate>navigation</a> sections cause <a href=#concept-appcache-init-with-attribute title=concept-appcache-init-with-attribute>cache selection</a>
+ to occur early in the page load process. A browsing context's
+ associated cache can also <a href=#appcache-history-2>change</a>
+ during <a href=#traverse-the-history title="traverse the history">session history
+ traversal</a>.</p>
<p>An application cache consists of:</p>
@@ -34361,11 +34357,12 @@ style/default.css</pre>
<li>
<p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-checking>checking</code> at the
- <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#top-level-browsing-context>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 user agent is checking for the availability of
- updates.</p>
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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>
@@ -34404,10 +34401,12 @@ style/default.css</pre>
as "304 Not Modified" or equivalent, then run these substeps:</p>
<ol><li><p><a href=#fire-a-simple-event>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-browsing-context>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>
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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>
<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
@@ -34430,10 +34429,12 @@ style/default.css</pre>
of <var title="">cache group</var> to <i>downloading</i>.</li>
<li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-downloading>downloading</code> at the
- <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#top-level-browsing-context>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 a new version is being downloaded.</li>
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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.</li>
<li><p>If this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade
attempt</a>, then let <var title="">new cache</var> be a newly
@@ -34471,12 +34472,13 @@ style/default.css</pre>
more of the URLs at a time.</p>
<ol><li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-progress><a href=#event-progress>progress</a></code> at the
- <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#top-level-browsing-context>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 a file is being downloaded in preparation for
- updating the application.</li> <!-- XXX need to include
- progress information -->
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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.</li> <!-- XXX
+ need to include progress information -->
<li>
@@ -34543,6 +34545,12 @@ style/default.css</pre>
entry as a <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic
entry</a>.</li>
+ <li><p>As an optimization, if the resource is an HTML or XML file
+ whose root element is an <code><a href=#the-html-element>html</a></code> element with a <code title=attr-html-manifest><a href=#attr-html-manifest>manifest</a></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
+ <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>.</p>
+
</ol></li>
<li><p>Store <var title="">manifest</var> in <var title="">new
@@ -34562,7 +34570,7 @@ style/default.css</pre>
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-browsing-context>top-level browsing
+ <p class=example>For example, if the <a href=#browsing-context>browsing
context</a>'s <a href=#active-document>active document</a> isn't itself listed
in the cache manifest, then it might still be being
downloaded.</p>
@@ -34585,11 +34593,12 @@ style/default.css</pre>
manifest URL's caches with <var title="">cache</var>.</p>
<p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-cached>cached</code> at the
- <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#top-level-browsing-context>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 has been cached and that they can
- now use it offline.</p>
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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 <a href=#concept-appcache-status title=concept-appcache-status>status</a> of
<var title="">cache group</var> to <i>idle</i>.</p>
@@ -34601,11 +34610,12 @@ style/default.css</pre>
<p>Otherwise, this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade attempt</a>:</p>
<p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-updateready>updateready</code> at the
- <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#top-level-browsing-context>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 a new version is available and that they can
- activate it by reloading the page.</p>
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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 <a href=#concept-appcache-status title=concept-appcache-status>status</a> of
<var title="">cache group</var> to <i>idle</i>.</p>
@@ -34615,11 +34625,12 @@ style/default.css</pre>
</ol><p>The <dfn id=cache-failure-steps>cache failure steps</dfn> are as follows:</p>
<ol><li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> at the
- <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#top-level-browsing-context>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 user agent failed to save the application for offline
- use.</li>
+ <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
+ context</a> whose <a href=#active-document>active document</a> 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.</li>
<li><p>If this is a <a href=#concept-appcache-cache title=concept-appcache-cache>cache
attempt</a>, then discard <var title="">cache</var> and abort
@@ -34668,23 +34679,14 @@ style/default.css</pre>
following list:</p>
<dl class=switch><dt>If the resource is not being loaded as part of navigation of a
- <a href=#top-level-browsing-context>top-level browsing context</a></dt>
+ <a href=#browsing-context>browsing context</a></dt>
<dd>
-
- <p>As an optimization, if the resource was loaded from an
- <a href=#application-cache>application cache</a>, 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 <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>.</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
@@ -34778,21 +34780,48 @@ style/default.css</pre>
</dl><p>When the <dfn id=concept-appcache-init-no-attribute 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
- <a href=#top-level-browsing-context>top-level browsing context</a>, and the resource was
- fetched from a particular <a href=#application-cache>application cache</a>, then the
- user agent must associate the <code>Document</code> with that
- application cache and invoke the <a href=#application-cache-update-process>application cache update
- process</a> 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
+ <a href=#browsing-context>browsing context</a>, and the resource was fetched from a
+ particular <a href=#application-cache>application cache</a></dt>
+
+ <dd>
+
+ <p>The user agent must associate the <code>Document</code> with
+ that application cache and invoke the <a href=#application-cache-update-process>application cache
+ update process</a> for that cache.
+
+ </dd>
+
+ <dt>If the resource is being loaded as part of navigation of a
+ <a href=#child-browsing-context>child browsing context</a></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 <a href=#active-document>active
+ document</a> of the <a href=#parent-browsing-context>parent browsing context</a>.</p>
+
+ </dd>
+
+ <dt>Otherwise</dt>
+
+ <dd>
+
+ <p>Nothing special happens with respect to application caches.</p>
+
+ </dd>
- <h5 id=changesToNetworkingModel><span class=secno>5.7.5.1 </span>Changes to the networking model</h5>
+ </dl><h5 id=changesToNetworkingModel><span class=secno>5.7.5.1 </span>Changes to the networking model</h5>
- <p>When a browsing context is associated with an <a href=#application-cache>application
- cache</a>, 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 <a href=#browsing-context>browsing context</a> is associated with an
+ <a href=#application-cache>application cache</a>, 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 <a href=#fetch>fetch</a> the resource
@@ -35636,13 +35665,11 @@ user reload must be equivalent to .reload()
<li>
<p>If the new resource is to be fetched using HTTP GET or
- equivalent, and if the browsing context being navigated is a
- <a href=#top-level-browsing-context>top-level browsing context</a>, then check if there are
- any <a href=#application-cache title="application cache">application caches</a> that
- have a <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>
- with the <a href=#same-origin>same origin</a> as the URL in question, and that
- have this URL as one of their entries (excluding entries marked as
- <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>), and that
+ equivalent, then check if there are any <a href=#application-cache title="application
+ cache">application caches</a> that have a <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> with the
+ <a href=#same-origin>same origin</a> as the URL in question, and that have
+ this URL as one of their entries, excluding entries marked as
+ <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, and that
already contain their manifest, categorized as a <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>. If so, then the
user agent must then get the resource from the <a href=#concept-appcache-selection title=concept-appcache-selection>most appropriate application
cache</a> of those that match.</p>
@@ -35689,13 +35716,12 @@ user reload must be equivalent to .reload()
and its URL <a href=#concept-appcache-matches-fallback title=concept-appcache-matches-fallback>matches the fallback
namespace</a> 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 <a href=#top-level-browsing-context>top-level browsing
- context</a>, 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 <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback resource</a>
specified for the <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespace</a> in
View
214 source
@@ -38392,21 +38392,17 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
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 @@ 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>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 @@ style/default.css</pre>
<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 @@ style/default.css</pre>
<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 @@ style/default.css</pre>
<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 @@ style/default.css</pre>
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 @@ style/default.css</pre>
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 @@ 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>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 @@ style/default.css</pre>
<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 @@ style/default.css</pre>
<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,24 +39382,14 @@ style/default.css</pre>
<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
@@ -39503,21 +39498,54 @@ style/default.css</pre>
<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 @@ user reload must be equivalent to .reload()
<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 @@ user reload must be equivalent to .reload()
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>

0 comments on commit 2f54561

Please sign in to comment.