Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 de5c371
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 29 deletions.
55 changes: 41 additions & 14 deletions index
Expand Up @@ -49146,6 +49146,9 @@ clock.js</pre>
<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>

Expand Down Expand Up @@ -49333,10 +49336,12 @@ style/default.css</pre>

<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
Expand Down Expand Up @@ -49370,7 +49375,10 @@ style/default.css</pre>
<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>
Expand Down Expand Up @@ -49410,6 +49418,9 @@ style/default.css</pre>
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>

Expand Down Expand Up @@ -49576,9 +49587,13 @@ style/default.css</pre>

<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>
Expand Down Expand Up @@ -49611,8 +49626,9 @@ style/default.css</pre>
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
Expand Down Expand Up @@ -49751,8 +49767,9 @@ style/default.css</pre>
<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>

Expand Down Expand Up @@ -50060,6 +50077,9 @@ style/default.css</pre>
<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
Expand Down Expand Up @@ -50387,6 +50407,11 @@ style/default.css</pre>

</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
Expand All @@ -50396,8 +50421,10 @@ style/default.css</pre>

<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>
Expand Down
64 changes: 49 additions & 15 deletions source
Expand Up @@ -55892,6 +55892,11 @@ interface <dfn>Function</dfn> {
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
Expand Down Expand Up @@ -56112,10 +56117,12 @@ style/default.css</pre>

<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
Expand Down Expand Up @@ -56154,7 +56161,10 @@ style/default.css</pre>
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>
Expand Down Expand Up @@ -56198,6 +56208,10 @@ style/default.css</pre>
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>

Expand Down Expand Up @@ -56394,9 +56408,14 @@ style/default.css</pre>

<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>
Expand Down Expand Up @@ -56433,8 +56452,9 @@ style/default.css</pre>
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>

Expand Down Expand Up @@ -56605,9 +56625,11 @@ style/default.css</pre>
<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>

Expand Down Expand Up @@ -56969,6 +56991,10 @@ style/default.css</pre>
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
Expand Down Expand Up @@ -57356,6 +57382,12 @@ style/default.css</pre>

</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
Expand All @@ -57367,8 +57399,10 @@ style/default.css</pre>

</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
Expand Down

0 comments on commit de5c371

Please sign in to comment.