Re: [w3c/ServiceWorker] How to create registration objects (#1445)

jakearchibald commented on this pull request.



> +      <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|.
+            1. Set |registrationObject|'s {{ServiceWorkerRegistration/waiting}} attribute to null if |registration|'s [=service worker registration/waiting worker=] is null, otherwise the result of [=getting the service worker object=] that represents |registration|'s [=service worker registration/waiting worker=] in |environment|.
+            1. Set |registrationObject|'s {{ServiceWorkerRegistration/active}} attribute to null if |registration|'s [=service worker registration/active worker=] is null, otherwise the result of [=getting the service worker object=] that represents |registration|'s [=service worker registration/active worker=] in |environment|.
+            1. Set |objectMap|[|registration|] to |registrationObject|.
+          1. Return |objectMap|[|registration|].
+      </section>
+    </section>
+
+    A {{ServiceWorkerRegistration}} has a <dfn for="ServiceWorkerRegistration">service worker registration</dfn> (a [=/service worker registration=]).

Oh yes. No idea why I put it here.

-- 
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_r298941115

Received on Monday, 1 July 2019 08:52:45 UTC