<h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 22 January 2009</h2>
<h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 23 January 2009</h2>
<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>
<dl><dt>Multiple-page version:</dt>
corresponding <code>Document</code> object. It is used during the
update process to ensure that new master entries are cached.</p>
<p>An <a href=#application-cache-group>application cache group</a> can be marked as <dfn id=concept-appcache-obsolete title=concept-appcache-obsolete>obsolete</dfn>, meaning that it
must be ignored when looking at what <a href=#application-cache-group title="application cache
group">application cache groups</a> exist.</p>
<hr><p>A <code>Document</code> initially is not associated with an
<a href=#application-cache>application cache</a>, but steps <a href=#parser-appcache>in the parser</a> and in the <a href=#navigate title=navigate>navigation</a> sections cause <a href=#concept-appcache-init title=concept-appcache-init>cache selection</a> to occur early
<ol><!-- XXX can they be merged with the cache failure steps? (event name is different, this always disassociates even for upgrades, anything else?) --><li><p>For each <a href=#browsing-context>browsing context</a> whose <a href=#active-document>active
<ol><li><p>Mark <var title="">cache group</var> as <a href=#concept-appcache-obsolete title=concept-appcache-obsolete>obsolete</a>. This <var title="">cache group</var> no longer exists for any purpose other
than the processing of <code>Document</code> objects already
associated with an <a href=#application-cache>application cache</a> in the <var title="">cache group</var>.</li>
<li><p>For each <a href=#browsing-context>browsing context</a> whose <a href=#active-document>active
document</a> is 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> called <code title=event-obsolete>obsolete</code> at the
that the application is no longer available for offline
use.</li>
<li><p>Unassociate any <code>Document</code> associated with an
<a href=#application-cache>application cache</a> in <var title="">cache
group</var>.</li>
<li><p>For each entry in <var title="">cache group</var>'s <a href=#concept-appcache-pending-masters title=concept-appcache-pending-masters>list of pending master
entries</a>, <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-error><a href=#event-error>error</a></code> (not
<code title=event-obsolete>obsolete</code>!) at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#browsing-context>browsing
context</a> whose <a href=#active-document>active document</a> is the
<code>Document</code> for this entry, if there still is one. The
default action of this event should be the display of some sort
of user interface indicating to the user that the user agent
failed to save the application for offline use.</li>
<li><p>If appropriate, remove any user interface indicating
that an update for this cache is in progress.</li>
<li><p>If <var title="">cache group</var> has an
<a href=#application-cache>application cache</a> whose <a href=#concept-appcache-completeness title=concept-appcache-completeness>completeness flag</a> is
<i>incomplete</i>, then discard that <a href=#application-cache>application
cache</a>.</p>
<li><p>Discard <var title="">cache group</var> and its associated
<a href=#application-cache title="application cache">application caches</a>, if
any.</p>
<li><p>If appropriate, remove any user interface indicating that
an update for this cache is in progress.</li>
<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>Abort the update process.</li>
const unsigned short <a href=#dom-appcache-checking title=dom-appcache-CHECKING>CHECKING</a> = 2;
const unsigned short <a href=#dom-appcache-downloading title=dom-appcache-DOWNLOADING>DOWNLOADING</a> = 3;
const unsigned short <a href=#dom-appcache-updateready title=dom-appcache-UPDATEREADY>UPDATEREADY</a> = 4;
const unsigned short <a href=#dom-appcache-obsolete title=dom-appcache-OBSOLETE>OBSOLETE</a> = 5;
readonly attribute unsigned short <a href=#dom-appcache-status title=dom-appcache-status>status</a>;
// updates
<dd><p>The <code><a href=#applicationcache>ApplicationCache</a></code> object is associated with
an <a href=#application-cache>application cache</a> whose <a href=#application-cache-group>application cache
status</a> is <i>idle</i>, but that application cache is
<em>not</em> the <a href=#concept-appcache-newer title=concept-appcache-newer>newest</a>
cache in its group.</dd>
status</a> is <i>idle</i>, and whose <a href=#application-cache-group>application cache
group</a> is not marked as <a href=#concept-appcache-obsolete title=concept-appcache-obsolete>obsolete</a>, but that
<a href=#application-cache>application cache</a> is <em>not</em> the <a href=#concept-appcache-newer title=concept-appcache-newer>newest</a> cache in its
<ol> <!-- XXX can they be merged with the cache failure steps? (event name is different, this always disassociates even for upgrades, anything else?) -->
<ol>
<li><p>Mark <var title="">cache group</var> as <span
title="concept-appcache-obsolete">obsolete</span>. This <var
title="">cache group</var> no longer exists for any purpose other
than the processing of <code>Document</code> objects already
associated with an <span>application cache</span> in the <var
title="">cache group</var>.</p></li>
<li><p>For each <span>browsing context</span> whose <span>active
document</span> is associated with an <span>application
that the application is no longer available for offline
use.</p></li>
<li><p>Unassociate any <code>Document</code> associated with an
<span>application cache</span> in <var title="">cache
group</var>.</p></li>
<li><p>For each entry in <var title="">cache group</var>'s <span
title="concept-appcache-pending-masters">list of pending master
entries</span>, <span>queue a task</span> to <span>fire a simple
event</span> called <code title="event-error">error</code> (not
<code title="event-obsolete">obsolete</code>!) at the
<code>ApplicationCache</code> singleton of the <span>browsing
context</span> whose <span>active document</span> is the
<code>Document</code> for this entry, if there still is one. The
default action of this event should be the display of some sort
of user interface indicating to the user that the user agent
failed to save the application for offline use.</p></li>
<li><p>If appropriate, remove any user interface indicating
that an update for this cache is in progress.</p></li>
<li><p>If <var title="">cache group</var> has an
<span>application cache</span> whose <span
title="concept-appcache-completeness">completeness flag</span> is
<i>incomplete</i>, then discard that <span>application
cache</span>.</p>
<li><p>Discard <var title="">cache group</var> and its associated
<span title="application cache">application caches</span>, if
any.</p>
<li><p>If appropriate, remove any user interface indicating that
an update for this cache is in progress.</p></li>
<li><p>Let the <span
title="concept-appcache-status">status</span> of <var
title="">cache group</var> be <i>idle</i>.</p></li>
<li><p>Abort the update process.</p></li>
const unsigned short <span title="dom-appcache-CHECKING">CHECKING</span> = 2;
const unsigned short <span title="dom-appcache-DOWNLOADING">DOWNLOADING</span> = 3;
const unsigned short <span title="dom-appcache-UPDATEREADY">UPDATEREADY</span> = 4;
const unsigned short <span title="dom-appcache-OBSOLETE">OBSOLETE</span> = 5;
readonly attribute unsigned short <span title="dom-appcache-status">status</span>;
// updates
<dd><p>The <code>ApplicationCache</code> object is associated with
an <span>application cache</span> whose <span>application cache