Skip to content

Commit

Permalink
Enable the client message queue
Browse files Browse the repository at this point in the history
A ServiceWorkerContainer object has a client message queue task
source, initially disabled, which holds tasks until the client is
ready to get the messages from its service worker. This patch adds a
condition that enables the task source:
 - when a document is dispatched a DOMContentLoaded event
 - when a worker client has executed run a worker algorithm

Related Issue: w3c/ServiceWorker#728
Related commit: w3c/ServiceWorker@5c0ecae
  • Loading branch information
jungkees authored and buildbot committed Jul 22, 2016
1 parent cd17646 commit 15bf57b
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3944,7 +3944,10 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<p>The following terms are defined in <cite>Service Workers</cite>: <ref spec="SW"></p>

<ul class="brief">
<li><dfn data-noexport="" data-x="dfn-client-message-queue" data-x-href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#dfn-client-message-queue">client message queue</dfn></li>
<li><dfn data-noexport="" data-x="scope-match-algorithm" data-x-href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#scope-match-algorithm">match service worker registration</dfn></li>
<li><dfn data-noexport="" data-x="service-worker-container-interface" data-x-href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-container-interface"><code>ServiceWorkerContainer</code></dfn> interface</li>
<li><dfn data-noexport="" data-x="dfn-service-worker-container-interface-client" data-x-href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#dfn-service-worker-container-interface-client">service worker client</dfn></li>
</ul>

</dd>
Expand Down Expand Up @@ -96336,6 +96339,11 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
source</span>, to <span data-x="concept-event-dispatch">dispatch</span> the event at <var>worker
global scope</var>.</p></li>

<li><p>Enable the <span data-x="dfn-client-message-queue">client message queue</span> of the
<span data-x="service-worker-container-interface">ServiceWorkerContainer</span> object whose
associated <span data-x="dfn-service-worker-container-interface-client">service worker
client</span> is <var>worker global scope</var>'s <span>relevant settings object</span>.</p></li>

<li>

<p><strong>Event loop<!-- labeled for ease of discussion --></strong>: Run the <span>responsible
Expand Down Expand Up @@ -107413,8 +107421,24 @@ document.body.appendChild(text);

</li>

<li><p><span>Queue a task</span> to <span>fire a simple event</span> that bubbles named <code
data-x="event-DOMContentLoaded">DOMContentLoaded</code> at the <code>Document</code>.</p></li>
<li>

<p><span>Queue a task</span> to run the following substeps:</p>

<ol>

<li><p><span>Fire a simple event</span> that bubbles named <code
data-x="event-DOMContentLoaded">DOMContentLoaded</code> at the <code>Document</code>.</p></li>

<li><p>Enable the <span data-x="dfn-client-message-queue">client message queue</span> of the
<span data-x="service-worker-container-interface">ServiceWorkerContainer</span> object whose
associated <span data-x="dfn-service-worker-container-interface-client">service worker
client</span> is the <code>Document</code>'s <code>Window</code> object's <span>relevant
settings object</span>.</p></li>

</ol>

</li>

<li><p><span>Spin the event loop</span> until the <span>set of scripts that will execute as soon
as possible</span> and the <span>list of scripts that will execute in order as soon as
Expand Down

0 comments on commit 15bf57b

Please sign in to comment.