Skip to content

Commit bca15cf

Browse files
committed
Enable the client message queue
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 (WIP): w3c/ServiceWorker@c2db88b
1 parent 37b83e9 commit bca15cf

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

source

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3932,7 +3932,10 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
39323932
<p>The following terms are defined in <cite>Service Workers</cite>: <ref spec="SW"></p>
39333933

39343934
<ul class="brief">
3935+
<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>
39353936
<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>
3937+
<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>
3938+
<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>
39363939
</ul>
39373940

39383941
</dd>
@@ -96439,6 +96442,11 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
9643996442
source</span>, to <span data-x="concept-event-dispatch">dispatch</span> the event at <var>worker
9644096443
global scope</var>.</p></li>
9644196444

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

9644496452
<p><strong>Event loop<!-- labeled for ease of discussion --></strong>: Run the <span>responsible
@@ -107571,8 +107579,24 @@ document.body.appendChild(text);
107571107579

107572107580
</li>
107573107581

107574-
<li><p><span>Queue a task</span> to <span>fire a simple event</span> that bubbles named <code
107575-
data-x="event-DOMContentLoaded">DOMContentLoaded</code> at the <code>Document</code>.</p></li>
107582+
<li>
107583+
107584+
<p><span>Queue a task</span> to run the following substeps:</p>
107585+
107586+
<ol>
107587+
107588+
<li><p><span>Fire a simple event</span> that bubbles named <code
107589+
data-x="event-DOMContentLoaded">DOMContentLoaded</code> at the <code>Document</code>.</p></li>
107590+
107591+
<li><p>Enable the <span data-x="dfn-client-message-queue">client message queue</span> of the
107592+
<span data-x="service-worker-container-interface">ServiceWorkerContainer</span> object whose
107593+
associated <span data-x="dfn-service-worker-container-interface-client">service worker
107594+
client</span> is the <code>Document</code>'s <code>Window</code> object's <span>relevant
107595+
settings object</span>.</p></li>
107596+
107597+
</ol>
107598+
107599+
</li>
107576107600

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

0 commit comments

Comments
 (0)