Skip to content

Commit

Permalink
[gw] (2) Make sure to propagate add() and remove() changes when updat…
Browse files Browse the repository at this point in the history
…ing the cache.

git-svn-id: http://svn.whatwg.org/webapps@2553 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 24, 2008
1 parent ab18067 commit 066d7d0
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 22 deletions.
49 changes: 38 additions & 11 deletions index
Expand Up @@ -36472,20 +36472,47 @@ style/default.css</pre>

<li>

<p>Otherwise, this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade attempt</a>:</p>
<p>Otherwise, this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade attempt</a>. Perform
the following substeps atomically, so as to avoid race
conditions:</p>

<p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-updateready>updateready</code> at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of 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>. The default
action of this event should be the display of some sort of user
interface indicating to the user that a new version is available
and that they can activate it by reloading the page.</p>
<ol><li>

<p>Set the <a href=#concept-appcache-status title=concept-appcache-status>status</a> of
<var title="">cache group</var> to <i>idle</i>.</p>
<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>

<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
<code><a href=#applicationcache>ApplicationCache</a></code> singleton. The default action of
these events should be the display of some sort of user
interface indicating to the user that a new version is available
and that they can activate it by reloading the page.</p>

<p class=note>Since this step merely queues tasks, and since
all these substeps are being done atomically, the next step is
guaranteed to happen before the events are actually
dispatched.</p>

</li>

<li>

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

</li>

</ol></li>

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

Expand Down
57 changes: 46 additions & 11 deletions source
Expand Up @@ -41496,19 +41496,54 @@ style/default.css</pre>
<li>

<p>Otherwise, this is an <span
title="concept-appcache-upgrade">upgrade attempt</span>:</p>
title="concept-appcache-upgrade">upgrade attempt</span>. Perform
the following substeps atomically, so as to avoid race
conditions:</p>

<p><span>Fire a simple event</span> called <code
title="event-updateready">updateready</code> at the
<code>ApplicationCache</code> singleton of each <span>browsing
context</span> whose <span>active document</span> is associated
with a cache in <var title="">cache group</var>. The default
action of this event should be the display of some sort of user
interface indicating to the user that a new version is available
and that they can activate it by reloading the page.</p>
<ol>

<li>

<p>If any <span title="concept-appcache-dynamic">dynamic
entries</span> in any of the <span title="application
cache">application caches</span> in the <var title="">cache
group</var> were added or removed (using the <code
title="dom-appcache-add">add()</code> and <code
title="dom-appcache-remove">remove()</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">add()</code> method if applicable.</p>

</li>

<p>Set the <span title="concept-appcache-status">status</span> of
<var title="">cache group</var> to <i>idle</i>.</p>
<li>

<p>For each <span>browsing context</span> whose <span>active
document</span> is associated with a cache in <var
title="">cache group</var>, <span>queue a task</span> to
<span>fire a simple event</span> called <code
title="event-updateready">updateready</code> at the relevant
<code>ApplicationCache</code> singleton. The default action of
these events should be the display of some sort of user
interface indicating to the user that a new version is available
and that they can activate it by reloading the page.</p>

<p class="note">Since this step merely queues tasks, and since
all these substeps are being done atomically, the next step is
guaranteed to happen before the events are actually
dispatched.</p>

</li>

<li>

<p>Set the <span title="concept-appcache-status">status</span>
of <var title="">cache group</var> to <i>idle</i>.</p>

</li>

</ol>

</li>

Expand Down

0 comments on commit 066d7d0

Please sign in to comment.