From aad6e539833d33b84cdb6f1e4b64ea295f7bc1f2 Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Fri, 22 Jul 2016 16:19:50 +0900 Subject: [PATCH] Service workers: 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 DOMContentLoaded is dispatched * when a worker client has executed run a worker algorithm Related issue: https://github.com/slightlyoff/ServiceWorker/issues/728 Related commit: https://github.com/slightlyoff/ServiceWorker/commit/5c0ecaeb423d04df7429bfaa2e5fbde9e42038e1 --- source | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/source b/source index ea0cf4242b7..c8326e37453 100644 --- a/source +++ b/source @@ -3944,7 +3944,10 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

The following terms are defined in Service Workers:

@@ -96320,6 +96323,11 @@ interface WorkerGlobalScope : EventTarget { source, to dispatch the event at worker global scope.

+
  • Enable the client message queue of the + ServiceWorkerContainer object whose + associated service worker + client is worker global scope's relevant settings object.

  • +
  • Event loop: Run the responsible @@ -107397,8 +107405,21 @@ document.body.appendChild(text);

  • -
  • Queue a task to fire a simple event that bubbles named DOMContentLoaded at the Document.

  • +
  • +

    Queue a task to run the following substeps:

    + +
      +
    1. Fire a simple event that bubbles named DOMContentLoaded at the Document + object.

    2. + +
    3. Enable the client message queue of the + ServiceWorkerContainer object whose + associated service worker + client is the Document object's relevant settings + object.

    4. +
    +
  • Spin the event loop until the set of scripts that will execute as soon as possible and the list of scripts that will execute in order as soon as