Skip to content

Commit

Permalink
Spec for skipWaiting
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Nov 6, 2014
1 parent c839e33 commit dcecb29
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/service_worker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ <h1><code>ServiceWorkerGlobalScope</code></h1>

void <a href="#service-worker-global-scope-update-method">update</a>();
<a href="http://goo.gl/3TobQS">Promise</a>&lt;boolean&gt; <a href="#service-worker-global-scope-unregister-method">unregister</a>();
<a href="http://goo.gl/3TobQS">Promise</a>&lt;undefined&gt; <a href="#service-worker-global-scope-skipwaiting-method">skipWaiting</a>();

attribute <a href="http://goo.gl/3nnYrx">EventHandler</a> <a href="#service-worker-global-scope-oninstall-attribute">oninstall</a>;
attribute <a href="http://goo.gl/3nnYrx">EventHandler</a> <a href="#service-worker-global-scope-onactivate-attribute">onactivate</a>;
Expand Down Expand Up @@ -720,6 +721,32 @@ <h1><code>unregister()</code></h1>
</spec-algorithm>
</spec-section>

<spec-section id="service-worker-global-scope-skipwaiting">
<h1><code>skipWaiting()</code></h1>

<p class="note">The <code><a href="#service-worker-global-scope-skipwaiting-method">skipWaiting()</a></code> method allows this <a href="#dfn-service-worker">service worker</a> to progress from the <a href="#dfn-containing-service-worker-registration">registration</a>'s <a href="#dfn-waiting-worker">waiting</a> position to <a href="#dfn-active-worker">active</a> even while <a href="#service-worker-client-concept">clients</a> are <a href="#dfn-use">using</a> the <a href="#dfn-containing-service-worker-registration">registration</a>.</p>

<p><dfn id="service-worker-global-scope-skipwaiting-method"><code>skipWaiting()</code></dfn> method must run these steps or their <a href="#dfn-processing-equivalence">equivalent</a>:</p>

<spec-algorithm>
<ol>
<li>Let <var>promise</var> be a new <a href="http://goo.gl/3TobQS">promise</a>.</li>
<li>Run the following substeps in parallel:
<ol>
<li>Set <a href="#dfn-service-worker">service worker</a>'s <a href="#dfn-skip-waiting-flag">skip waiting flag</a></li>
<li>If <a href="#dfn-service-worker">service worker</a>'s <a href="#dfn-state">state</a> is <em>installed</em>, then:
<ol>
<li>Run <a href="#activation-algorithm">Activate</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing <a href="#dfn-service-worker">service worker</a>'s <a href="#dfn-containing-service-worker-registration">registration</a> as the argument.</li>
</ol>
</li>
<li>Resolve <var>promise</var> with undefined.</li>
</ol>
</li>
<li>Return <var>promise</var>.</li>
</ol>
</spec-algorithm>
</spec-section>

<spec-section id="service-worker-global-scope-event-handlers">
<h1>Event handlers</h1>

Expand Down

0 comments on commit dcecb29

Please sign in to comment.