- From: Jake Archibald <notifications@github.com>
- Date: Mon, 01 Jul 2019 01:51:23 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1445/review/256206736@github.com>
jakearchibald commented on this pull request. > @@ -477,7 +477,27 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe }; </pre> - A {{ServiceWorkerRegistration}} object represents a [=/service worker registration=]. Each {{ServiceWorkerRegistration}} object is associated with a <dfn for="ServiceWorkerRegistration">service worker registration</dfn> (a [=/service worker registration=]). Multiple separate objects implementing the {{ServiceWorkerRegistration}} interface across documents and workers can all be associated with the same [=/service worker registration=] simultaneously. + <section> + <h4 id="service-worker-registration-creation">Getting {{ServiceWorkerRegistration}} instances</h4> + + An [=environment settings object=] has a <dfn for="environment settings object">service worker registration object map</dfn>, a [=/map=] where the [=map/keys=] are [=/service worker registrations=] and the [=map/values=] are {{ServiceWorkerRegistration}} objects. + + <section algorithm="service-worker-registration-creation-algorithm"> + To <dfn lt="get the service worker registration object|getting the service worker registration object">get the service worker registration object</dfn> representing |registration| (a [=/service worker registration=]) in |environment| (an [=environment settings object=]), run these steps: + + 1. Let |objectMap| be |environment|'s [=environment settings object/service worker registration object map=]. + 1. If |objectMap|[|registration|] does not [=map/exist=], then: + 1. Let |registrationObject| be a new {{ServiceWorkerRegistration}} in |environment|'s [=environment settings object/Realm=]. + 1. Set |registrationObject|'s [=ServiceWorkerRegistration/service worker registration=] to |registration|. + 1. Set |registrationObject|'s {{ServiceWorkerRegistration/installing}} attribute to null if |registration|'s [=service worker registration/installing worker=] is null, otherwise the result of [=getting the service worker object=] that represents |registration|'s [=service worker registration/installing worker=] in |environment|. Ugh really? I kinda hate that form since you have to read on to realise it's an "otherwise". But I guess the real problem here is it's too long for a one-liner. I'll split it up. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/pull/1445#discussion_r298940709
Received on Monday, 1 July 2019 08:51:45 UTC