Skip to content
Permalink
Browse files

[gw] (2) appcache: Add support for '*' in the online whitelist, allow…

…ing caches to be used without failing on non-cached resources.

git-svn-id: http://svn.whatwg.org/webapps@3453 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jul 20, 2009
1 parent 1171681 commit de5c371fd5fc0b13c4b5bf65cebea3b06741e201
Showing with 90 additions and 29 deletions.
  1. +41 −14 index
  2. +49 −15 source
55 index
<li>Zero or more URLs that form the <dfn id=concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist
namespaces</dfn>.

<li>An <dfn id=concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
wildcard flag</dfn>, which is either <i title="">open</i> or <i title="">blocking</i>.</li>

</ul><p>Each <a href=#application-cache>application cache</a> has a <dfn id=concept-appcache-completeness title=concept-appcache-completeness>completeness flag</dfn>, which is
either <i>complete</i> or <i>incomplete</i>.</p>


<p>When the current section is the explicit section or the online
whitelist section, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a
<a href=#valid-url>valid URL</a> identifying a resource other than the
manifest itself, and then zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters.</p>
SPACE and U+0009 CHARACTER TABULATION (tab) characters, either a
single U+002A ASTERISK character (*) <!--
concept-appcache-onlinewhitelist-wildcard --> or a <a href=#valid-url>valid
URL</a> identifying a resource other than the manifest itself,
and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
(tab) characters.</p>

<p>When the current section is the fallback section, data lines
must consist of zero or more U+0020 SPACE and U+0009 CHARACTER
<p>URLs that the user agent is to put into the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a>
must all be specified in online whitelist sections. (This is needed
for any URL that the page is intending to use to communicate back to
the server.)</p>
the server.) To specify that all URLs are automatically whitelisted
in this way, a U+002A ASTERISK character (*) character may be
specified as one of the URLs. <!--
concept-appcache-onlinewhitelist-wildcard --></p>

<p>Relative URLs must be given relative to the manifest's own
URL.</p>
initially empty list of URLs for a <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online
whitelist</a>.</li>

<li><p>Let <var title="">online whitelist wildcard flag</var> be <i title="">blocking</i>. <!--
concept-appcache-onlinewhitelist-wildcard --></li>

<li><p>Let <var title="">input</var> be the decoded text of the
manifest's byte stream.</li>


<dd>

<p><a href=#resolve-a-url title="resolve a url">Resolve</a> the first item in
<var title="">tokens</var>, relative to <var title="">base
URL</var>; ignore the rest.</p>
<p>If the first item in <var title="">tokens</var> is a U+002A
ASTERISK character (*), then set <var title="">online whitelist
wildcard flag</var> to <i title="">open</i> and jump back to the
step labeled "start of line".</p>

<p>Otherwise, <a href=#resolve-a-url title="resolve a url">resolve</a> the
first item in <var title="">tokens</var>, relative to <var title="">base URL</var>; ignore the rest.</p>

<p>If this fails, then jump back to the step labeled "start of
line".</p>
jumps to the next, and last, step when the end of the file is
reached.)</li>

<li><p>Return the <var title="">explicit URLs</var> list, the <var title="">fallback URLs</var> mapping, and the <var title="">online
whitelist URLs</var>.</li>
<li><p>Return the <var title="">explicit URLs</var> list, the <var title="">fallback URLs</var> mapping, the <var title="">online
whitelist URLs</var>, and the <var title="">online whitelist
wildcard flag</var>.</li>

</ol><p class=note>If a resource is listed in the explicit section and
matches an entry in the online whitelist, or if a resource matches
<a href=#concept-appcache-explicit title=concept-appcache-explicit>explicit entries</a>,
<a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entries</a>
and the <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback
namespaces</a> that map to them, and entries for the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online
whitelist</a>.</p>
namespaces</a> that map to them, entries for the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a>,
and a value for the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
wildcard flag</a>.</p>

</li>

<li><p>Store the URLs that form the new <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a> in
<var title="">new cache</var>.</li>

<li><p>Store the value of the new <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
wildcard flag</a> in <var title="">new cache</var>.</li>

<li>

<p>For each entry in <var title="">cache group</var>'s <a href=#concept-appcache-pending-masters title=concept-appcache-pending-masters>list of pending master

</li>

<li><p>If the <a href=#application-cache>application cache</a>'s <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
wildcard flag</a> is <i title="">open</i>, then
<a href=#fetch>fetch</a> the resource normally and abort these
steps.</li>

<li><p>If there is an entry in the <a href=#application-cache>application cache</a>'s
<a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online
whitelist</a> that has the <a href=#same-origin>same origin</a> as the

<li><p>Fail the resource load.</li>

</ol><p class=note>The above algorithm ensures that resources that are
not present in the <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> will always fail
</ol><p class=note>The above algorithm ensures that so long as the
<a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online
whitelist wildcard flag</a> is <i title="">blocking</i>,
resources that are not present in the <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a> will always fail
to load (at least, after the <a href=#application-cache>application cache</a> has been
primed the first time), making the testing of offline applications
simpler.</p>
64 source
title="concept-appcache-onlinewhitelist">online whitelist
namespaces</dfn>.

<li>An <dfn
title="concept-appcache-onlinewhitelist-wildcard">online whitelist
wildcard flag</dfn>, which is either <i title="">open</i> or <i
title="">blocking</i>.</li>

</ul>

<p>Each <span>application cache</span> has a <dfn

<p>When the current section is the explicit section or the online
whitelist section, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a
<span>valid URL</span> identifying a resource other than the
manifest itself, and then zero or more U+0020 SPACE and U+0009
CHARACTER TABULATION (tab) characters.</p>
SPACE and U+0009 CHARACTER TABULATION (tab) characters, either a
single U+002A ASTERISK character (*) <!--
concept-appcache-onlinewhitelist-wildcard --> or a <span>valid
URL</span> identifying a resource other than the manifest itself,
and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
(tab) characters.</p>

<p>When the current section is the fallback section, data lines
must consist of zero or more U+0020 SPACE and U+0009 CHARACTER
title="concept-appcache-onlinewhitelist">online whitelist</span>
must all be specified in online whitelist sections. (This is needed
for any URL that the page is intending to use to communicate back to
the server.)</p>
the server.) To specify that all URLs are automatically whitelisted
in this way, a U+002A ASTERISK character (*) character may be
specified as one of the URLs. <!--
concept-appcache-onlinewhitelist-wildcard --></p>

<p>Relative URLs must be given relative to the manifest's own
URL.</p>
title="concept-appcache-onlinewhitelist">online
whitelist</span>.</p></li>

<li><p>Let <var title="">online whitelist wildcard flag</var> be <i
title="">blocking</i>. <!--
concept-appcache-onlinewhitelist-wildcard --></p></li>

<li><p>Let <var title="">input</var> be the decoded text of the
manifest's byte stream.</p></li>


<dd>

<p><span title="resolve a url">Resolve</span> the first item in
<var title="">tokens</var>, relative to <var title="">base
URL</var>; ignore the rest.</p>
<p>If the first item in <var title="">tokens</var> is a U+002A
ASTERISK character (*), then set <var title="">online whitelist
wildcard flag</var> to <i title="">open</i> and jump back to the
step labeled "start of line".</p>

<p>Otherwise, <span title="resolve a url">resolve</span> the
first item in <var title="">tokens</var>, relative to <var
title="">base URL</var>; ignore the rest.</p>

<p>If this fails, then jump back to the step labeled "start of
line".</p>
reached.)</p></li>

<li><p>Return the <var title="">explicit URLs</var> list, the <var
title="">fallback URLs</var> mapping, and the <var title="">online
whitelist URLs</var>.</p></li>
title="">fallback URLs</var> mapping, the <var title="">online
whitelist URLs</var>, and the <var title="">online whitelist
wildcard flag</var>.</p></li>

</ol>

<span title="concept-appcache-explicit">explicit entries</span>,
<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>
namespaces</span> that map to them, entries for the <span
title="concept-appcache-onlinewhitelist">online whitelist</span>,
and a value for the <span
title="concept-appcache-onlinewhitelist-wildcard">online whitelist
wildcard flag</span>.</p>

</li>

title="concept-appcache-onlinewhitelist">online whitelist</span> in
<var title="">new cache</var>.</p></li>

<li><p>Store the value of the new <span
title="concept-appcache-onlinewhitelist-wildcard">online whitelist
wildcard flag</span> in <var title="">new cache</var>.</p></li>

<li>

<p>For each entry in <var title="">cache group</var>'s <span

</li>

<li><p>If the <span>application cache</span>'s <span
title="concept-appcache-onlinewhitelist-wildcard">online whitelist
wildcard flag</span> is <i title="">open</i>, then
<span>fetch</span> the resource normally and 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

</ol>

<p class="note">The above algorithm ensures that resources that are
not present in the <span
<p class="note">The above algorithm ensures that so long as the
<span title="concept-appcache-onlinewhitelist-wildcard">online
whitelist wildcard flag</span> is <i title="">blocking</i>,
resources that are not present in the <span
title="concept-appcache-manifest">manifest</span> will always fail
to load (at least, after the <span>application cache</span> has been
primed the first time), making the testing of offline applications

0 comments on commit de5c371

Please sign in to comment.
You can’t perform that action at this time.