Skip to content
Permalink
Browse files
[giow] (1) Delay appcache events if the document hasn't loaded yet.
git-svn-id: http://svn.whatwg.org/webapps@4582 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 13, 2010
1 parent 8e41cb4 commit 61f6b5643cac7599d11023bb5bd123159db32edf
Showing with 204 additions and 84 deletions.
  1. +64 −28 complete.html
  2. +64 −28 index
  3. +76 −28 source
@@ -110,7 +110,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 12 January 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 13 January 2010</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -54213,6 +54213,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp
not show prominent update progress notifications for applications
that cancel the relevant events.</p>

<p class=note>These events are delayed until after the <code title=event-load>load</code> event has fired.</p>

<p>The <a href=#application-cache-download-process>application cache download process</a> steps are as
follows:

@@ -54275,8 +54277,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>If these steps were invoked with a <a href=#cache-host>cache
host</a>, and the <a href=#concept-appcache-status title=concept-appcache-status>status</a> of <var title="">cache group</var> is <i>checking</i> or
<i>downloading</i>, then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
a simple event</a> named <code title=event-appcache-checking><a href=#event-appcache-checking>checking</a></code> that is
<i>downloading</i>, then <a href=#queue-a-post-load-task>queue a post-load task</a> to
<a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-appcache-checking><a href=#event-appcache-checking>checking</a></code> that is
cancelable at the <code><a href=#applicationcache>ApplicationCache</a></code> singleton of that
<a href=#cache-host>cache host</a>. The default action of this event must
be, if the user agent <a href=#shows-caching-progress>shows caching progress</a>, the
@@ -54286,8 +54288,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>If these steps were invoked with a <a href=#cache-host>cache
host</a>, and the <a href=#concept-appcache-status title=concept-appcache-status>status</a> of <var title="">cache group</var> is <i>downloading</i>, then also
<a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
named <code title=event-appcache-downloading><a href=#event-appcache-downloading>downloading</a></code> that is
<a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-appcache-downloading><a href=#event-appcache-downloading>downloading</a></code> that is
cancelable at the <code><a href=#applicationcache>ApplicationCache</a></code> singleton of that
<a href=#cache-host>cache host</a>. The default action of this event must
be, if the user agent <a href=#shows-caching-progress>shows caching progress</a>, the
@@ -54304,8 +54306,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>For each <a href=#cache-host>cache host</a> associated with an
<a href=#application-cache>application cache</a> 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> that is cancelable named <code title=event-appcache-checking><a href=#event-appcache-checking>checking</a></code> at the
group</var>, <a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#fire-a-simple-event>fire a
simple event</a> that is cancelable named <code title=event-appcache-checking><a href=#event-appcache-checking>checking</a></code> at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache
host</a>. The default action of these events must be, if the
user agent <a href=#shows-caching-progress>shows caching progress</a>, the display of
@@ -54323,8 +54325,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>If this is a <a href=#concept-appcache-cache title=concept-appcache-cache>cache
attempt</a>, then this algorithm was invoked with a <a href=#cache-host>cache
host</a>; <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-appcache-checking><a href=#event-appcache-checking>checking</a></code> that is cancelable
host</a>; <a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#fire-a-simple-event>fire a
simple event</a> named <code title=event-appcache-checking><a href=#event-appcache-checking>checking</a></code> that is cancelable
at the <code><a href=#applicationcache>ApplicationCache</a></code> singleton of that <a href=#cache-host>cache
host</a>. The default action of this event must be, if the user
agent <a href=#shows-caching-progress>shows caching progress</a>, the display of some sort
@@ -54396,8 +54398,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>Let the <a href=#concept-appcache-status title=concept-appcache-status>status</a> of <var title="">cache group</var> be <i>idle</i>.</li>

<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-task title="queue a task">queue</a>
that task.</li>
<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-post-load-task title="queue a post-load
task">queue that task as a post-load task</a>.</li>

<li><p>Abort the <a href=#application-cache-download-process>application cache download
process</a>.</li>
@@ -54482,8 +54484,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>Let the <a href=#concept-appcache-status title=concept-appcache-status>status</a> of <var title="">cache group</var> be <i>idle</i>.</li>

<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-task title="queue a task">queue</a>
that task.</li>
<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-post-load-task title="queue a post-load
task">queue that task as a post-load task</a>.</li>

<li><p>Abort the <a href=#application-cache-download-process>application cache download
process</a>.</li>
@@ -54504,8 +54506,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>For each <a href=#cache-host>cache host</a> associated with an
<a href=#application-cache>application cache</a> 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> that
is cancelable named <code title=event-appcache-downloading><a href=#event-appcache-downloading>downloading</a></code> at the
<a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> that is cancelable named <code title=event-appcache-downloading><a href=#event-appcache-downloading>downloading</a></code> at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache
host</a>. The default action of these events must be, if the
user agent <a href=#shows-caching-progress>shows caching progress</a>, the display of some
@@ -54554,9 +54556,9 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>For each <a href=#cache-host>cache host</a> associated with an
<a href=#application-cache>application cache</a> in <var title="">cache
group</var>, <a href=#queue-a-task>queue a task</a> to fire an event with the
name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which
does not bubble, which is cancelable, and which uses the
group</var>, <a href=#queue-a-post-load-task>queue a post-load task</a> to fire an event
with the name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not
bubble, which is cancelable, and which uses the
<code>ProgressEvent</code> interface, at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache
host</a>. The <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code>
@@ -54682,8 +54684,9 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp

<li><p>For each <a href=#cache-host>cache host</a> associated with an
<a href=#application-cache>application cache</a> in <var title="">cache group</var>,
<a href=#queue-a-task>queue a task</a> to fire an event with the name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not
bubble, which is cancelable, and which uses the
<a href=#queue-a-post-load-task>queue a post-load task</a> to fire an event with the name
<code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does
not bubble, which is cancelable, and which uses the
<code>ProgressEvent</code> interface, at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache
host</a>. The <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code>
@@ -54716,7 +54719,7 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp
<ol><li><p>Unassociate the <code>Document</code> for this entry from
<var title="">new cache</var>.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
<li><p><a href=#queue-a-post-load-task>Queue a post-load task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> that is cancelable named <code title=event-appcache-error><a href=#event-appcache-error>error</a></code> at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the
<code>Document</code> for this entry, if there still is one. The
@@ -54818,8 +54821,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp
status</a> of <var title="">cache group</var> to
<i>idle</i>.</li>

<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-task title="queue a task">queue</a>
that task.</li>
<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-post-load-task title="queue a post-load
task">queue that task as a post-oad task</a>.</li>

</ol><p>The <dfn id=cache-failure-steps>cache failure steps</dfn> are as follows:</p>

@@ -54878,8 +54881,8 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp
attempt</a>, discard <var title="">cache group</var>
altogether.</p>

<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-task title="queue a task">queue</a>
that task.</li>
<li><p>For each <a href=#concept-task title=concept-task>task</a> in <var title="">task list</var>, <a href=#queue-a-post-load-task title="queue a post-load
task">queue that task as a post-load task</a>.</li>

<li><p>Abort the <a href=#application-cache-download-process>application cache download
process</a>.</li>
@@ -54895,7 +54898,28 @@ <h4 id=downloading-or-updating-an-application-cache><span class=secno>6.9.4 </sp
allows user agents to keep caches primed and to update caches even
before the user visits a site.</p>

<p>The <a href=#task-source>task source</a> for these <a href=#concept-task title=concept-task>tasks</a> is the <a href=#networking-task-source>networking task
<hr><p>Each <code>Document</code> has a list of <dfn id=pending-application-cache-download-process-tasks>pending application
cache download process tasks</dfn> that is used to delay events
fired by the algorithm above until the document's <code title=event-load>load</code> event has fired. When the
<code>Document</code> is created, the list must be empty.</p>

<p>When the steps above say to <dfn id=queue-a-post-load-task>queue a post-load task</dfn>
<var title="">task</var>, where <var title="">task</var> is a <a href=#concept-task title=concept-task>task</a> that dispatches an event on a
target <code><a href=#applicationcache>ApplicationCache</a></code> object <var title="">target</var>, the user agent must run the appropriate steps
from the following list:</p>

<dl><dt>If <var title="">target</var>'s <code>Document</code> has
<a href=#completely-loaded>completely loaded</a></dt>

<dd><p><a href=#queue-a-task title="queue a task">Queue</a> the task <var title="">task</var>.</dd>

<dt>Otherwise</dt>

<dd><p>Add <var title="">task</var> to <var title="">target</var>'s
<code>Document</code>'s list of <a href=#pending-application-cache-download-process-tasks>pending application cache
download process tasks</a>.</dd>

</dl><p>The <a href=#task-source>task source</a> for these <a href=#concept-task title=concept-task>tasks</a> is the <a href=#networking-task-source>networking task
source</a>.</p>


@@ -76627,8 +76651,20 @@ <h4 id=the-end><span class=secno>11.2.6 </span>The end</h4>
must bubble but not be cancelable and has no default
action.</li>

</ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> mentioned in this section is the
<a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>
<li><p>If the <code>Document</code> has any <a href=#pending-application-cache-download-process-tasks>pending
application cache download process tasks</a>, then <a href=#queue-a-task title="queue a task">queue</a> each such <a href=#concept-task title=concept-task>task</a> in the order they were added to
the list of <a href=#pending-application-cache-download-process-tasks>pending application cache download process
tasks</a>, and then empty the list of <a href=#pending-application-cache-download-process-tasks>pending application
cache download process tasks</a>. The <a href=#task-source>task source</a>
for these <a href=#concept-task title=concept-task>tasks</a> is the
<a href=#networking-task-source>networking task source</a>.</li>

<li><p>The <code>Document</code> is now <dfn id=completely-loaded>completely
loaded</dfn>.</li>

</ol><p>Except where otherwise specified, the <a href=#task-source>task source</a>
for the <a href=#concept-task title=concept-task>tasks</a> mentioned in this
section is the <a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>

</div>

0 comments on commit 61f6b56

Please sign in to comment.