Skip to content

Commit

Permalink
[giow] (3) appcache: coalesce queued progress events.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17688
Affected topics: Offline Web Applications

git-svn-id: http://svn.whatwg.org/webapps@8751 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 5, 2014
1 parent 232f467 commit 26f2dac
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 14 deletions.
21 changes: 15 additions & 6 deletions complete.html
Expand Up @@ -61274,7 +61274,7 @@ <h4 id=downloading-or-updating-an-application-cache>7.7.4 Downloading or updatin
lesser-used resources first.</p>

<li><p>For each <a href=#cache-host id=downloading-or-updating-an-application-cache:cache-host-16>cache host</a> associated with an <a href=#application-cache id=downloading-or-updating-an-application-cache:application-cache-14>application cache</a> in
<var>cache group</var>, <a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-8>queue a post-load task</a> to <a href=#concept-event-fire id=downloading-or-updating-an-application-cache:concept-event-fire>fire</a> a <a href=#concept-events-trusted id=downloading-or-updating-an-application-cache:concept-events-trusted>trusted</a>
<var>cache group</var>, <a href=#queue-a-progress-post-load-task id=downloading-or-updating-an-application-cache:queue-a-progress-post-load-task>queue a progress post-load task</a> to <a href=#concept-event-fire id=downloading-or-updating-an-application-cache:concept-event-fire>fire</a> a <a href=#concept-events-trusted id=downloading-or-updating-an-application-cache:concept-events-trusted>trusted</a>
event with the name <code id=downloading-or-updating-an-application-cache:event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not
bubble, which is cancelable, and which uses the <code id=downloading-or-updating-an-application-cache:progressevent><a href=#progressevent>ProgressEvent</a></code> interface, at the
<code id=downloading-or-updating-an-application-cache:applicationcache-11><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host id=downloading-or-updating-an-application-cache:cache-host-17>cache host</a>. The <code id=downloading-or-updating-an-application-cache:dom-progressevent-lengthcomputable><a href=#dom-progressevent-lengthcomputable>lengthComputable</a></code> attribute must be set to
Expand Down Expand Up @@ -61365,7 +61365,7 @@ <h4 id=downloading-or-updating-an-application-cache>7.7.4 Downloading or updatin

</ol>

<li><p>For each <a href=#cache-host id=downloading-or-updating-an-application-cache:cache-host-18>cache host</a> associated with an <a href=#application-cache id=downloading-or-updating-an-application-cache:application-cache-17>application cache</a> in <var>cache group</var>, <a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-9>queue a post-load task</a> to <a href=#concept-event-fire id=downloading-or-updating-an-application-cache:concept-event-fire-2>fire</a> a <a href=#concept-events-trusted id=downloading-or-updating-an-application-cache:concept-events-trusted-2>trusted</a>
<li><p>For each <a href=#cache-host id=downloading-or-updating-an-application-cache:cache-host-18>cache host</a> associated with an <a href=#application-cache id=downloading-or-updating-an-application-cache:application-cache-17>application cache</a> in <var>cache group</var>, <a href=#queue-a-progress-post-load-task id=downloading-or-updating-an-application-cache:queue-a-progress-post-load-task-2>queue a progress post-load task</a> to <a href=#concept-event-fire id=downloading-or-updating-an-application-cache:concept-event-fire-2>fire</a> a <a href=#concept-events-trusted id=downloading-or-updating-an-application-cache:concept-events-trusted-2>trusted</a>
event with the name <code id=downloading-or-updating-an-application-cache:event-appcache-progress-2><a href=#event-appcache-progress>progress</a></code>, which does not bubble,
which is cancelable, and which uses the <code id=downloading-or-updating-an-application-cache:progressevent-2><a href=#progressevent>ProgressEvent</a></code> interface, at the
<code id=downloading-or-updating-an-application-cache:applicationcache-12><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host id=downloading-or-updating-an-application-cache:cache-host-19>cache host</a>. The <code id=downloading-or-updating-an-application-cache:dom-progressevent-lengthcomputable-2><a href=#dom-progressevent-lengthcomputable>lengthComputable</a></code> attribute must be set to
Expand All @@ -61387,7 +61387,7 @@ <h4 id=downloading-or-updating-an-application-cache>7.7.4 Downloading or updatin
"no-store" cache directive, then run these substeps:</p>

<ol><li><p>Unassociate the <code id=downloading-or-updating-an-application-cache:document-7><a href=#document>Document</a></code> for this entry from <var>new
cache</var>.<li><p><a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-10>Queue a post-load task</a> to <a href=#fire-a-simple-event id=downloading-or-updating-an-application-cache:fire-a-simple-event-10>fire a simple event</a> that is
cache</var>.<li><p><a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-8>Queue a post-load task</a> to <a href=#fire-a-simple-event id=downloading-or-updating-an-application-cache:fire-a-simple-event-10>fire a simple event</a> that is
cancelable named <code id=downloading-or-updating-an-application-cache:event-appcache-error-3><a href=#event-appcache-error>error</a></code> at the
<code id=downloading-or-updating-an-application-cache:applicationcache-13><a href=#applicationcache>ApplicationCache</a></code> singleton of the <code id=downloading-or-updating-an-application-cache:document-8><a href=#document>Document</a></code> for this entry, if there
still is one. The default action of this event must be, if the user agent <a href=#shows-caching-progress id=downloading-or-updating-an-application-cache:shows-caching-progress-12>shows caching
Expand Down Expand Up @@ -61459,7 +61459,7 @@ <h4 id=downloading-or-updating-an-application-cache>7.7.4 Downloading or updatin

<li><p>If appropriate, remove any user interface indicating that an update for this cache is in
progress.<li><p>Set the <a href=#concept-appcache-status id=downloading-or-updating-an-application-cache:concept-appcache-status-8>update status</a> of <var>cache
group</var> to <i>idle</i>.<li><p>For each <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-13>task</a> in <var>task list</var>, <a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-11>queue that task as a post-load task</a>.</ol>
group</var> to <i>idle</i>.<li><p>For each <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-13>task</a> in <var>task list</var>, <a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-9>queue that task as a post-load task</a>.</ol>

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

Expand Down Expand Up @@ -61496,7 +61496,7 @@ <h4 id=downloading-or-updating-an-application-cache>7.7.4 Downloading or updatin
progress.<li><p>Let the <a href=#concept-appcache-status id=downloading-or-updating-an-application-cache:concept-appcache-status-9>status</a> of <var>cache
group</var> be <i>idle</i>.<li><p>If this was a <a href=#concept-appcache-cache id=downloading-or-updating-an-application-cache:concept-appcache-cache-4>cache attempt</a>, discard <var>cache group</var> altogether.</p>

<li><p>For each <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-17>task</a> in <var>task list</var>, <a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-12>queue that task as a post-load task</a>.<li><p>Abort the <a href=#application-cache-download-process id=downloading-or-updating-an-application-cache:application-cache-download-process-11>application cache download process</a>.</ol>
<li><p>For each <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-17>task</a> in <var>task list</var>, <a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-10>queue that task as a post-load task</a>.<li><p>Abort the <a href=#application-cache-download-process id=downloading-or-updating-an-application-cache:application-cache-download-process-11>application cache download process</a>.</ol>

<p>Attempts to <a href=#fetch id=downloading-or-updating-an-application-cache:fetch-6>fetch</a> resources as part of the <a href=#application-cache-download-process id=downloading-or-updating-an-application-cache:application-cache-download-process-12>application cache download
process</a> may be done with cache-defeating semantics, to avoid problems with stale or
Expand Down Expand Up @@ -61524,7 +61524,16 @@ <h4 id=downloading-or-updating-an-application-cache>7.7.4 Downloading or updatin
<a href=#ready-for-post-load-tasks id=downloading-or-updating-an-application-cache:ready-for-post-load-tasks>ready for post-load tasks</a><dd><p><a href=#queue-a-task id=downloading-or-updating-an-application-cache:queue-a-task>Queue</a> the task <var>task</var>.<dt>Otherwise<dd><p>Add <var>task</var> to <var>target</var>'s <a id=downloading-or-updating-an-application-cache:node-document-2 href=http://dom.spec.whatwg.org/#concept-node-document data-x-internal=node-document>node document</a>'s list
of <a href=#pending-application-cache-download-process-tasks id=downloading-or-updating-an-application-cache:pending-application-cache-download-process-tasks>pending application cache download process tasks</a>.</dl>

<p>The <a href=#task-source id=downloading-or-updating-an-application-cache:task-source>task source</a> for these <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-19>tasks</a> is the
<p>When the steps above say to <dfn id=queue-a-progress-post-load-task>queue a progress post-load task</dfn> <var>task</var>, where
<var>task</var> is a <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-19>task</a> that dispatches an event on a
target <code id=downloading-or-updating-an-application-cache:applicationcache-19><a href=#applicationcache>ApplicationCache</a></code> object <var>target</var>, the user agent must run
the following steps:</p>

<ol><li><p>If there is a <var>task</var> in <var>target</var>'s <a id=downloading-or-updating-an-application-cache:node-document-3 href=http://dom.spec.whatwg.org/#concept-node-document data-x-internal=node-document>node document</a>'s list
of <a href=#pending-application-cache-download-process-tasks id=downloading-or-updating-an-application-cache:pending-application-cache-download-process-tasks-2>pending application cache download process tasks</a> that is labeled as a
<i>progress task</i>, then remove that task from the list.<li><p>Label <var>task</var> as a <i>progress task</i>.<li><p><a href=#queue-a-post-load-task id=downloading-or-updating-an-application-cache:queue-a-post-load-task-11>Queue a post-load task</a> <var>task</var>.</ol>

<p>The <a href=#task-source id=downloading-or-updating-an-application-cache:task-source>task source</a> for these <a href=#concept-task id=downloading-or-updating-an-application-cache:concept-task-20>tasks</a> is the
<a href=#networking-task-source id=downloading-or-updating-an-application-cache:networking-task-source>networking task source</a>.</p>


Expand Down

0 comments on commit 26f2dac

Please sign in to comment.