Skip to content

Commit

Permalink
Fix #51: introduce respond-with entered flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jungkees committed Aug 6, 2014
1 parent f60dfca commit dfa1536
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/service_worker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ <h1><code>Cache</code></h1>

<p>Each <code><a href="#cache-interface">Cache</a></code> object is associated with a <a href="#request-to-response-map-internal-interface">[[RequestToResponseMap]]</a>. Multiple separate objects implementing the <code><a href="#cache-interface">Cache</a></code> interface across <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#worker-environment">service worker environments</a> can all be associated with the same <a href="#request-to-response-map-internal-interface">[[RequestToResponseMap]]</a> simultaneously.</p>

<p class="fixme"><strong>Caveat: </strong>Implementors should note that the interface defined in this section is subject to change according to the <a href="https://github.com/slightlyoff/ServiceWorker/issues">ongoing discussion</a>. </p>

<spec-section id="cache-match">
<h1><code>match(<var>request</var>, <var>params</var>)</code></h1>

Expand Down Expand Up @@ -1472,6 +1474,7 @@ <h1><code>FetchEvent</code></h1>
<p>Each event using <code><a href="#fetch-event-interface">FetchEvent</a></code> interface has the following associated flag that is initially unset:
<ul>
<li><dfn id="wait-to-respond-flag">wait to respond flag</dfn></li>
<li><dfn id="respond-with-entered-flag">respond-with entered flag</dfn></li>
<li><dfn id="respond-with-error-flag">respond-with error flag</dfn></li>
</ul>
</p>
Expand All @@ -1484,12 +1487,13 @@ <h1><code>event.respondWith(r)</code></h1>
<p><dfn id="fetch-event-respondwith-method"><code>respondWith(<var>r</var>)</code></dfn> method must run these steps or their <a href="#dfn-processing-equivalence">equivalent</a>:</p>
<spec-algorithm>
<ol>
<li>If the <a href="#wait-to-respond-flag">wait to respond flag</a> is set, then:
<li>If the <a href="#respond-with-entered-flag">respond-with entered flag</a> is set, then:
<ol>
<li><a href="http://dom.spec.whatwg.org/#concept-throw">Throw</a> an "<code><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code>" exception.</li>
<li>Abort these steps.</li>
</ol>
</li>
<li>Set the <a href="#respond-with-entered-flag">respond-with entered flag</a>.</li>
<li>Set the <a href="#wait-to-respond-flag">wait to respond flag</a>.</li>
<li>Wait until <var>r</var> settles.</li>
<li>If <var>r</var> rejected with an exception, then:
Expand Down Expand Up @@ -2082,9 +2086,13 @@ <h1>[[HandleFetch]]</h1>
</ol>
</li>
<li>Let <var>event</var> be the event for which this <a href="http://dom.spec.whatwg.org/#concept-event-listener">event listener</a> was invoked.</li>
<li>If <var>event</var>'s <a href="#wait-to-respond-flag">wait to respond flag</a> is set, then:
<li>If <var>event</var>'s <a href="#respond-with-entered-flag">respond-with entered flag</a> is set, then:
<ol>
<li>Set <var>respondWithEntered</var> to true.</li>
</ol>
</li>
<li>If <var>event</var>'s <a href="#wait-to-respond-flag">wait to respond flag</a> is set, then:
<ol>
<li>Wait until <var>event</var>'s <a href="#wait-to-respond-flag">wait to respond flag</a> is unset.</li>
<li>If <var>event</var>'s <a href="#respond-with-error-flag">respond-with error flag</a> is set, then:
<ol>
Expand Down

0 comments on commit dfa1536

Please sign in to comment.