Skip to content

Commit

Permalink
[] (0) Remove dynamic entries from the application cache for now.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@2691 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 22, 2009
1 parent 510a158 commit 3043b3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 270 deletions.
128 changes: 9 additions & 119 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -36565,7 +36565,7 @@ interface <dfn id=function>Function</dfn> {

<dt><dfn id=concept-appcache-manifest title=concept-appcache-manifest>The manifest</dfn>

<dd>The resource corresponding to the URL that was given in an
<dd>The resource corresponding to the URL that was given in a
master entry's <code><a href=#the-html-element>html</a></code> element's <code title=attr-html-manifest><a href=#attr-html-manifest>manifest</a></code> attribute. The
manifest is fetched and processed during the <a href=#application-cache-update-process>application
cache update process</a>. All the <a href=#concept-appcache-master title=concept-appcache-master>master entries</a> have
Expand All @@ -36586,14 +36586,11 @@ interface <dfn id=function>Function</dfn> {
entries.


<dt><dfn id=concept-appcache-dynamic title=concept-appcache-dynamic>Dynamic entries</dfn>

<dd>Resources that were added to the cache by the <code title=dom-appcache-add><a href=#dom-appcache-add>add()</a></code> method.

</dl><p class=note>A URL in the list can be flagged with multiple
different types, and thus an entry can end up being categorized as
multiple entries. For example, an entry can be an explicit entry
and a dynamic entry at the same time.</p>
multiple entries. For example, an entry can be a manfiest entry
and an explicit entry at the same time, if the manifest is listed
within the manifest.</p>

</li>

Expand Down Expand Up @@ -36639,7 +36636,7 @@ interface <dfn id=function>Function</dfn> {
# there can be as many of these anywhere in the file
# they are all ignored
# comments can have spaces before them
# but most be alone on the line
# but must be alone on the line

# blank lines are ignored too

Expand Down Expand Up @@ -37215,10 +37212,6 @@ style/default.css</pre>
attempt</a>, then add all the URLs of <a href=#concept-appcache-master title=concept-appcache-master>master entries</a> in <var title="">cache</var> to <var title="">file list</var>, each flagged
with "master entry".</li>

<li><p>If this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade
attempt</a>, then add all the URLs of <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entries</a> in <var title="">cache</var> to <var title="">file list</var>, each flagged
with "dynamic entry".</li>

<li><p>If any URL is in <var title="">file list</var> more than
once, then merge the entries into one entry for that URL, that
entry having all the flags that the original entries had.</li>
Expand Down Expand Up @@ -37347,11 +37340,6 @@ style/default.css</pre>
entry as a <a href=#concept-appcache-master title=concept-appcache-master>master
entry</a>.</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 <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
Expand Down Expand Up @@ -37446,18 +37434,6 @@ style/default.css</pre>

<ol><li>

<p>If any <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic
entries</a> in any of the <a href=#application-cache title="application
cache">application caches</a> in the <var title="">cache
group</var> were added or removed (using the <code title=dom-appcache-add><a href=#dom-appcache-add>add()</a></code> and <code title=dom-appcache-remove><a href=#dom-appcache-remove>remove()</a></code> methods) while the
update process was in progress, then replay the sequence of adds
and removes on <var title="">cache</var>, using the resources
that were fetched by the <code title=dom-appcache-add><a href=#dom-appcache-add>add()</a></code> method if applicable.</p>

</li>

<li>

<p>For 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>, <a href=#queue-a-task>queue a task</a> to
<a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-updateready>updateready</code> at the relevant
Expand Down Expand Up @@ -37675,9 +37651,9 @@ style/default.css</pre>
<a href=#fetch>fetch</a> the resource normally and abort these
steps.</li>

<li><p>If the resource's URL is <a href=#concept-appcache-master title=concept-appcache-master>an master entry</a>, <a href=#concept-appcache-manifest title=concept-appcache-manifest>the manifest</a>, <a href=#concept-appcache-explicit title=concept-appcache-explicit>an explicit entry</a>, <a href=#concept-appcache-fallback title=concept-appcache-fallback>a fallback entry</a>, or a
<a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entry</a> in the
<a href=#application-cache>application cache</a>, then get the resource from the
<li><p>If the resource's URL is <a href=#concept-appcache-master title=concept-appcache-master>a master entry</a>, <a href=#concept-appcache-manifest title=concept-appcache-manifest>the manifest</a>, <a href=#concept-appcache-explicit title=concept-appcache-explicit>an explicit entry</a>, or
<a href=#concept-appcache-fallback title=concept-appcache-fallback>a fallback entry</a> in
the <a href=#application-cache>application cache</a>, then get the resource from the
cache (instead of fetching it), and abort these steps.</li>

<li>
Expand Down Expand Up @@ -37730,12 +37706,6 @@ style/default.css</pre>
void <a href=#dom-appcache-update title=dom-appcache-update>update</a>();
void <a href=#dom-appcache-swapcache title=dom-appcache-swapCache>swapCache</a>();

// dynamic entries
readonly attribute <span>DOMStringList</span> <a href=#dom-appcache-items title=dom-appcache-items>items</a>;
boolean <a href=#dom-appcache-hasitem title=dom-appcache-hasItem>hasItem</a>(in DOMString url);
void <a href=#dom-appcache-add title=dom-appcache-add>add</a>(in DOMString url);
void <a href=#dom-appcache-remove title=dom-appcache-remove>remove</a>(in DOMString url);

// events
attribute <a href=#function>Function</a> <a href=#handler-appcache-onchecking title=handler-appcache-onchecking>onchecking</a>;
attribute <a href=#function>Function</a> <a href=#handler-appcache-onerror title=handler-appcache-onerror>onerror</a>;
Expand Down Expand Up @@ -37821,87 +37791,7 @@ style/default.css</pre>
<i>obsolete</i> <a href=#concept-appcache-lifecycle title=concept-appcache-lifecycle>lifecycle
status</a>.</dd>

</dl><hr><p>The <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entries</a>
in the <a href=#application-cache>application cache</a> are ordered in the same order
as they were added to the cache by the <code title=dom-appcache-add><a href=#dom-appcache-add>add()</a></code> method, with the oldest entry
being the zeroth entry.</p>

<p>The <dfn id=dom-appcache-items title=dom-appcache-items><code>items</code></dfn> DOM
attribute must return a new <code>DOMStringList</code> object. If
the <code><a href=#applicationcache>ApplicationCache</a></code> object has an associated
<a href=#application-cache>application cache</a> with one or more <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entries</a>, then the
<code>DOMStringList</code> object's items must be the <a href=#absolute-url title="absolute URL">absolute URLs</a> of the <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entries</a> in that
<a href=#application-cache>application cache</a>, in order; otherwise, the object must
have no entries.</p>

<p>The <dfn id=dom-appcache-hasitem title=dom-appcache-hasItem><code>hasItem(<var title="">url</var>)</code></dfn> method must run the following
steps:</p>

<ol><li><p>If the <code><a href=#applicationcache>ApplicationCache</a></code> object is not
associated with any application cache, then raise an
<code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception and abort these
steps.</li>

<li><p><a href=#resolve-a-url title="resolve a URL">Resolve</a> the <var title="">url</var> argument. If this fails, raise a
<code><a href=#syntax_err>SYNTAX_ERR</a></code> exception and abort these steps.</li>

<li><p>If there is already a resource in in the <a href=#application-cache>application
cache</a> with which the <code><a href=#applicationcache>ApplicationCache</a></code> object is
associated that has the address <var title="">url</var>, and that
entry is categorized as a <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entry</a>, then return
true.</li>

<li><p>Otherwise, return false.</li>

</ol><p>The <dfn id=dom-appcache-add title=dom-appcache-add><code>add(<var title="">url</var>)</code></dfn> method must run the following
steps:</p>

<ol><li><p>If the <code><a href=#applicationcache>ApplicationCache</a></code> object is not
associated with any application cache, then raise an
<code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception and abort these
steps.</li>

<li><p><a href=#resolve-a-url title="resolve a URL">Resolve</a> the <var title="">url</var> argument. If this fails, raise a
<code><a href=#syntax_err>SYNTAX_ERR</a></code> exception and abort these steps.</li>

<li><p>If there is already a resource in in the <a href=#application-cache>application
cache</a> with which the <code><a href=#applicationcache>ApplicationCache</a></code> object is
associated that has the address <var title="">url</var>, then
ensure that entry is categorized as a <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entry</a> and return
and abort these steps.</li>

<li><p>If <var title="">url</var> has a different <a href=#url-scheme title=url-scheme>&lt;scheme&gt;</a> component than the
manifest's URL, then raise a <code><a href=#security_err>SECURITY_ERR</a></code>
exception.</li>

<li><p>Return, but do not abort these steps.</li>

<li><p><a href=#fetch>Fetch</a> the resource referenced by <var title="">url</var>.</li>

<li><p>If this results in a redirect, or a 4xx or 5xx status code
<a href=#concept-http-equivalent-codes title=concept-http-equivalent-codes>or equivalent</a>,
or if there were network errors, or if the user canceled the
download, then abort these steps.</li>

<li><p>Add the fetched resource to the <a href=#application-cache>application
cache</a> and categorize it as a <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entry</a>.</li>

</ol><p>The <dfn id=dom-appcache-remove title=dom-appcache-remove><code>remove(<var title="">url</var>)</code></dfn> method must <a href=#resolve-a-url title="resolve a
url">resolve</a> the <var title="">url</var> argument and, if
that is successful, remove the <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic entry</a> categorization
of any entry whose address is the resulting <a href=#absolute-url>absolute
URL</a> in the <a href=#application-cache>application cache</a> with which the
<code><a href=#applicationcache>ApplicationCache</a></code> object is associated. If this removes
the last categorization of an entry in that cache, then the entry
must be removed entirely (such that if it is re-added, it will be
loaded from the network again). If the <code><a href=#applicationcache>ApplicationCache</a></code>
object is not associated with any application cache, then the method
must raise an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code> exception instead.</p>

<p class=warning>Authors should bear in mind that multiple scripts
could be simultaneously modifying the same application cache.</p>

<hr><p>If the <dfn id=dom-appcache-update title=dom-appcache-update><code>update()</code></dfn> method is
</dl><hr><p>If the <dfn id=dom-appcache-update title=dom-appcache-update><code>update()</code></dfn> method is
invoked, the user agent must invoke the <a href=#application-cache-update-process>application cache
update process</a>, in the background, for the <a href=#application-cache>application
cache</a> with which the <code><a href=#applicationcache>ApplicationCache</a></code> object is
Expand Down
Loading

0 comments on commit 3043b3d

Please sign in to comment.