Skip to content
Permalink
Browse files

[giow] (0) Add a feature to appcache to make it possible to mark a ca…

…che as preferring online resources than cached resources.

Affected topics: HTML, Offline Web Applications

git-svn-id: http://svn.whatwg.org/webapps@7136 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jun 14, 2012
1 parent 4fd61bb commit cfa0e09395daa9a41c13c12b638d31eb113887e9
Showing with 402 additions and 30 deletions.
  1. +125 −10 complete.html
  2. +125 −10 index
  3. +152 −10 source
<li>Some predefined <a href=#mdvocabs>Microdata vocabularies</a>.</li>
<li>The <code><a href=#the-data-element>data</a></code> element for marking up machine-readable data.</li><!--DATA--><!--FORK-->
<li>The <code title=scheme-http+aes><a href=#http+aes-scheme>http+aes:</a></code> and <code title=scheme-http+aes><a href=#http+aes-scheme>https+aes:</a></code> schemes.</li><!--FORK-->
<li>The <a href=#application-cache>application cache</a> feature's <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a> mode.</li><!--FORK--><!--APPCACHE-PREFER-ONLINE-->
</ul><!--
<p>Features that are part of the WHATWG HTML Living Standard
specification but that are currently published as separate

<!-- this is filler to make sure the TCP packet boundary doesn't fall in the middle of one of the NCRs below -->
<!-- (because otherwise the parser in anolis screws it up) -->
<p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like &#2310; are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like " height=300 src=http://images.whatwg.org/baselines.png width=738>x00C1;, &yuml;, f, and &Omega; are anchored, the ideographic baseline is where glyphs like &#31169; and &#36948; are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square."&gt;</p>
<p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like &#2310; are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like &Aacute;, &yuml;, f, and &Omega; are anchored, the ideographic baseline is where glyphs like &#31169; and &#36948; are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square." height=300 src=http://images.whatwg.org/baselines.png width=738></p>

<p>The keywords map to these alignment points as follows:</p>

application caches</a> that are identified by a URL 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>, 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>
<a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, and whose
<a href=#concept-appcache-mode title=concept-appcache-mode>mode</a> is <a href=#concept-appcache-mode-fast title=concept-appcache-mode-fast>fast</a>, 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>

<p class=example>For example, imagine an HTML page with an
associated application cache displaying an image and a form, where

</li>

<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
<li>

<p>If the resource was not fetched from an <a href=#application-cache>application
cache</a>, and was to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and

there are <a href=#relevant-application-cache title="relevant application cache">relevant
application caches</a> that are identified by a URL 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 whose
<a href=#concept-appcache-mode title=concept-appcache-mode>mode</a> is <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a>,
and the user didn't cancel the navigation attempt during the
earlier step, and the navigation attempt failed (e.g. the server
returned a 4xx or 5xx status code <a href=#concept-http-equivalent-codes title=concept-http-equivalent-codes>or equivalent</a>, or
there was a DNS error), then:</p>

<p>Let <var title="">candidate</var> be the resource identified by
the URL in question from the <a href=#concept-appcache-selection title=concept-appcache-selection>most appropriate application
cache</a> of those that match.</p> <!-- note that a redirect
can never reach this point as it is handled earlier, meaning that
a captive portal captures URLs in "prefer-online" caches and you
can't ever get to the cached resource of a prefer-online cache if
you have a captive portal -->

<p>If <var title="">candidate</var> is not marked as <a href=#concept-appcache-foreign title=concept-appcache-foreign>foreign</a>, then the user
agent must discard the failed load and instead continue along
these steps using <var title="">candidate</var> as the resource.
The user agent may indicate to the user that the original page
load failed, and that the page used was a previously cached
resource.</p>

</li>
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->

<li>

<p><i>Resource handling</i>: If the resource's out-of-band
<td> The user agent will try fetching the files again momentarily.
</table><div class=impl>

<h4 id=appcache><span class=secno>6.7.2 </span>Application caches</h4>
<h4 id=appcache><span class=secno>6.7.2 </span>Application caches</h4> <!--APPCACHE-->

<p>An <dfn id=application-cache>application cache</dfn> is a set of cached resources
consisting of:</p>

</li>

<li>

<p>A <dfn id=concept-appcache-mode title=concept-appcache-mode>cache mode flag</dfn>,
which is
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
either
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
in the <dfn id=concept-appcache-mode-fast title=concept-appcache-mode-fast><i>fast</i></dfn>
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
state or the <dfn id=concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online><i>prefer-online</i></dfn>
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
state.</p>

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


<dt>A section header
<dd>
<p>Section headers change the current section. There are three

<p>Section headers change the current section. There are four
possible section headers:

<dl><dt><code>CACHE:</code>
<dt><code>NETWORK:</code>
<dd>Switches to the <dfn id=concept-appcache-manifest-network title=concept-appcache-manifest-network>online whitelist section</dfn>.

<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
<dt><code>SETTINGS:</code>
<dd>Switches to the <dfn id=concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings section</dfn>.
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->

</dl><p>Section header lines must consist of zero or more U+0020 SPACE
and U+0009 CHARACTER TABULATION (tab) characters, followed by one
of the names above (including the U+003A COLON character (:))
and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
(tab) characters.</p>

<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
<p>When the current section is the <a href=#concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings
section</a>, data lines must consist of zero or more U+0020
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a <a href=#concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</a>, and then
zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION (tab)
characters.</p>

<p>Currently only one <dfn id=concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</dfn> is
defined:</p>

<dl><dt>The cache mode setting</dt>

<dd>This consists of the string "<code title="">prefer-online</code>". It sets the <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode</a> to <a href=#concept-appcache-mode-prefer-online title=concept-appcache-mode-prefer-online>prefer-online</a>.
(The <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode</a>
defaults to <a href=#concept-appcache-mode-fast title=concept-appcache-mode-fast>fast</a>.)</dd>

</dl><p>Within a <a href=#concept-appcache-manifest-settings title=concept-appcache-manifest-settings>settings
section</a>, each <a href=#concept-appcache-manifest-setting title=concept-appcache-manifest-setting>setting</a> must
occur no more than once.</p>
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->

<!--
<p class="note">The URLs in data lines can't be empty strings,
since those would be relative URLs to the manifest itself. Such
<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="">cache mode flag</var> be <i title="">fast</i>. <!-- concept-appcache-mode-fast --></li>

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

"NETWORK" followed by a U+003A COLON character (:)), then set <var title="">mode</var> to "online whitelist" and jump back to the step
labeled "start of line".</li>

<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
<li><p>If <var title="">line</var> equals "SETTINGS:" (the word
"SETTINGS" followed by a U+003A COLON character (:)), then set <var title="">mode</var> to "settings" and jump back to the step labeled
"start of line".</li>
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->

<li><p>If <var title="">line</var> ends with a U+003A COLON
character (:), then set <var title="">mode</var> to "unknown" and
jump back to the step labeled "start of line".</li>

</dd>

<!--FORK--><!--APPCACHE-PREFER-ONLINE-->
<dt>If <var title="">mode</var> is "settings"</dt>

<dd>

<p>If <var title="">tokens</var> contains a single token, and
that token is a <a href=#case-sensitive>case-sensitive</a> match for the string
"<code title="">prefer-online</code>", then set <var title="">cache mode flag</var> to <i title="">prefer-online</i>
and jump back to the step labeled "start of line".</p>

<p>Otherwise, the line is an unsupported setting: do nothing;
the line is ignored.</p>

</dd>
<!--FORK--><!--APPCACHE-PREFER-ONLINE-->

<dt>If <var title="">mode</var> is "unknown"</dt>

<dd>
reached.)</li>

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

</ol><div class=note>

obtaining a list of <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, 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>
and values for the <a href=#concept-appcache-onlinewhitelist-wildcard title=concept-appcache-onlinewhitelist-wildcard>online whitelist
wildcard flag</a> and the <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode flag</a>.</p>

<p class=note>The <a href=#mime-type>MIME type</a> of the resource is
ignored &mdash; it is assumed to be
<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>Store the value of the new <a href=#concept-appcache-mode title=concept-appcache-mode>cache mode 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
the <a href=#concept-appcache-master title=concept-appcache-master>master</a>
resource.</p>

<p>If there are <a href=#relevant-application-cache title="relevant application cache">relevant
application caches</a> that are identified by a URL with the
<a href=#same-origin>same origin</a> as the URL of <var title="">document</var>, 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>, then the user
agent should use the <a href=#concept-appcache-selection title=concept-appcache-selection>most
appropriate application cache</a> of those that match as an
HTTP cache for any subresource loads. User agents may also have
other caches in place that are also honored.</p>

</dd>


0 comments on commit cfa0e09

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