[html5] r4582 - [giow] (1) Delay appcache events if the document hasn't loaded yet.

whatwg at whatwg.org whatwg at whatwg.org
Tue Jan 12 17:35:58 PST 2010


Author: ianh
Date: 2010-01-12 17:35:55 -0800 (Tue, 12 Jan 2010)
New Revision: 4582

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Delay appcache events if the document hasn't loaded yet.

Modified: complete.html
===================================================================
--- complete.html	2010-01-12 11:45:42 UTC (rev 4581)
+++ complete.html	2010-01-13 01:35:55 UTC (rev 4582)
@@ -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 — 12 January 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 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 @@
   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 @@
 
      <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 @@
 
      <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 @@
 
      <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 @@
 
    <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 @@
 
      <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 @@
 
      <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 @@
 
    <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 @@
 
      <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 @@
 
    <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 @@
     <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 @@
    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 @@
    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 @@
   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,9 +76651,21 @@
    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>
 
 

Modified: index
===================================================================
--- index	2010-01-12 11:45:42 UTC (rev 4581)
+++ index	2010-01-13 01:35:55 UTC (rev 4582)
@@ -112,7 +112,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>HTML5 (including next generation additions still in development)</h1>
-    <h2 class="no-num no-toc">Draft Standard — 12 January 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 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>-->
@@ -54124,6 +54124,8 @@
   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:
 
@@ -54186,8 +54188,8 @@
 
      <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
@@ -54197,8 +54199,8 @@
 
      <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
@@ -54215,8 +54217,8 @@
 
      <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
@@ -54234,8 +54236,8 @@
 
    <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
@@ -54307,8 +54309,8 @@
 
      <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>
@@ -54393,8 +54395,8 @@
 
      <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>
@@ -54415,8 +54417,8 @@
 
    <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
@@ -54465,9 +54467,9 @@
 
      <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>
@@ -54593,8 +54595,9 @@
 
    <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>
@@ -54627,7 +54630,7 @@
     <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
@@ -54729,8 +54732,8 @@
    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>
 
@@ -54789,8 +54792,8 @@
    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>
@@ -54806,7 +54809,28 @@
   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>
   
 
@@ -70981,9 +71005,21 @@
    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>
 
 

Modified: source
===================================================================
--- source	2010-01-12 11:45:42 UTC (rev 4581)
+++ source	2010-01-13 01:35:55 UTC (rev 4582)
@@ -61189,6 +61189,9 @@
   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 <span>application cache download process</span> steps are as
   follows:
 
@@ -61268,8 +61271,8 @@
      host</span>, and the <span
      title="concept-appcache-status">status</span> of <var
      title="">cache group</var> is <i>checking</i> or
-     <i>downloading</i>, then <span>queue a task</span> to <span>fire
-     a simple event</span> named <code
+     <i>downloading</i>, then <span>queue a post-load task</span> to
+     <span>fire a simple event</span> named <code
      title="event-appcache-checking">checking</code> that is
      cancelable at the <code>ApplicationCache</code> singleton of that
      <span>cache host</span>. The default action of this event must
@@ -61282,8 +61285,8 @@
      host</span>, and the <span
      title="concept-appcache-status">status</span> of <var
      title="">cache group</var> is <i>downloading</i>, then also
-     <span>queue a task</span> to <span>fire a simple event</span>
-     named <code
+     <span>queue a post-load task</span> to <span>fire a simple
+     event</span> named <code
      title="event-appcache-downloading">downloading</code> that is
      cancelable at the <code>ApplicationCache</code> singleton of that
      <span>cache host</span>. The default action of this event must
@@ -61303,8 +61306,8 @@
 
      <li><p>For each <span>cache host</span> associated with an
      <span>application cache</span> in <var title="">cache
-     group</var>, <span>queue a task</span> to <span>fire a simple
-     event</span> that is cancelable named <code
+     group</var>, <span>queue a post-load task</span> to <span>fire a
+     simple event</span> that is cancelable named <code
      title="event-appcache-checking">checking</code> at the
      <code>ApplicationCache</code> singleton of the <span>cache
      host</span>. The default action of these events must be, if the
@@ -61326,8 +61329,8 @@
 
    <li><p>If this is a <span title="concept-appcache-cache">cache
    attempt</span>, then this algorithm was invoked with a <span>cache
-   host</span>; <span>queue a task</span> to <span>fire a simple
-   event</span> named <code
+   host</span>; <span>queue a post-load task</span> to <span>fire a
+   simple event</span> named <code
    title="event-appcache-checking">checking</code> that is cancelable
    at the <code>ApplicationCache</code> singleton of that <span>cache
    host</span>. The default action of this event must be, if the user
@@ -61416,8 +61419,8 @@
      title="">cache group</var> be <i>idle</i>.</p></li>
 
      <li><p>For each <span title="concept-task">task</span> in <var
-     title="">task list</var>, <span title="queue a task">queue</span>
-     that task.</p></li>
+     title="">task list</var>, <span title="queue a post-load
+     task">queue that task as a post-load task</span>.</p></li>
 
      <li><p>Abort the <span>application cache download
      process</span>.</p></li>
@@ -61521,8 +61524,8 @@
      title="">cache group</var> be <i>idle</i>.</p></li>
 
      <li><p>For each <span title="concept-task">task</span> in <var
-     title="">task list</var>, <span title="queue a task">queue</span>
-     that task.</p></li>
+     title="">task list</var>, <span title="queue a post-load
+     task">queue that task as a post-load task</span>.</p></li>
 
      <li><p>Abort the <span>application cache download
      process</span>.</p></li>
@@ -61547,8 +61550,8 @@
 
    <li><p>For each <span>cache host</span> associated with an
    <span>application cache</span> in <var title="">cache group</var>,
-   <span>queue a task</span> to <span>fire a simple event</span> that
-   is cancelable named <code
+   <span>queue a post-load task</span> to <span>fire a simple
+   event</span> that is cancelable named <code
    title="event-appcache-downloading">downloading</code> at the
    <code>ApplicationCache</code> singleton of the <span>cache
    host</span>. The default action of these events must be, if the
@@ -61605,9 +61608,10 @@
 
      <li><p>For each <span>cache host</span> associated with an
      <span>application cache</span> in <var title="">cache
-     group</var>, <span>queue a task</span> to fire an event with the
-     name <code title="event-appcache-progress">progress</code>, which
-     does not bubble, which is cancelable, and which uses the
+     group</var>, <span>queue a post-load task</span> to fire an event
+     with the name <code
+     title="event-appcache-progress">progress</code>, which does not
+     bubble, which is cancelable, and which uses the
      <code>ProgressEvent</code> interface, at the
      <code>ApplicationCache</code> singleton of the <span>cache
      host</span>. The <code
@@ -61747,9 +61751,9 @@
 
    <li><p>For each <span>cache host</span> associated with an
    <span>application cache</span> in <var title="">cache group</var>,
-   <span>queue a task</span> to fire an event with the name <code
-   title="event-appcache-progress">progress</code>, which does not
-   bubble, which is cancelable, and which uses the
+   <span>queue a post-load task</span> to fire an event with the name
+   <code title="event-appcache-progress">progress</code>, which does
+   not bubble, which is cancelable, and which uses the
    <code>ProgressEvent</code> interface, at the
    <code>ApplicationCache</code> singleton of the <span>cache
    host</span>. The <code
@@ -61792,7 +61796,7 @@
      <li><p>Unassociate the <code>Document</code> for this entry from
      <var title="">new cache</var>.</p></li>
 
-     <li><p><span>Queue a task</span> to <span>fire a simple
+     <li><p><span>Queue a post-load task</span> to <span>fire a simple
      event</span> that is cancelable named <code
      title="event-appcache-error">error</code> at the
      <code>ApplicationCache</code> singleton of the
@@ -61914,8 +61918,8 @@
    <i>idle</i>.</p></li>
 
    <li><p>For each <span title="concept-task">task</span> in <var
-   title="">task list</var>, <span title="queue a task">queue</span>
-   that task.</p></li>
+   title="">task list</var>, <span title="queue a post-load
+   task">queue that task as a post-oad task</span>.</p></li>
 
   </ol>
 
@@ -61989,8 +61993,8 @@
    altogether.</p>
 
    <li><p>For each <span title="concept-task">task</span> in <var
-   title="">task list</var>, <span title="queue a task">queue</span>
-   that task.</p></li>
+   title="">task list</var>, <span title="queue a post-load
+   task">queue that task as a post-load task</span>.</p></li>
 
    <li><p>Abort the <span>application cache download
    process</span>.</p></li>
@@ -62010,6 +62014,37 @@
   allows user agents to keep caches primed and to update caches even
   before the user visits a site.</p>
 
+  <hr>
+
+  <p>Each <code>Document</code> has a list of <dfn>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>queue a post-load task</dfn>
+  <var title="">task</var>, where <var title="">task</var> is a <span
+  title="concept-task">task</span> that dispatches an event on a
+  target <code>ApplicationCache</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
+   <span>completely loaded</span></dt>
+
+   <dd><p><span title="queue a task">Queue</span> the task <var
+   title="">task</var>.</p></dd>
+
+   <dt>Otherwise</dt>
+
+   <dd><p>Add <var title="">task</var> to <var title="">target</var>'s
+   <code>Document</code>'s list of <span>pending application cache
+   download process tasks</span>.</p></dd>
+
+  </dl>
+
   <p>The <span>task source</span> for these <span
   title="concept-task">tasks</span> is the <span>networking task
   source</span>.</p>
@@ -87418,11 +87453,24 @@
    must bubble but not be cancelable and has no default
    action.</p></li>
 
+   <li><p>If the <code>Document</code> has any <span>pending
+   application cache download process tasks</span>, then <span
+   title="queue a task">queue</span> each such <span
+   title="concept-task">task</span> in the order they were added to
+   the list of <span>pending application cache download process
+   tasks</span>, and then empty the list of <span>pending application
+   cache download process tasks</span>. The <span>task source</span>
+   for these <span title="concept-task">tasks</span> is the
+   <span>networking task source</span>.</p></li>
+
+   <li><p>The <code>Document</code> is now <dfn>completely
+   loaded</dfn>.</p></li>
+
   </ol>
 
-  <p>The <span>task source</span> for the <span
-  title="concept-task">tasks</span> mentioned in this section is the
-  <span>DOM manipulation task source</span>.</p>
+  <p>Except where otherwise specified, the <span>task source</span>
+  for the <span title="concept-task">tasks</span> mentioned in this
+  section is the <span>DOM manipulation task source</span>.</p>
 
   </div>
 




More information about the Commit-Watchers mailing list