Skip to content

Commit

Permalink
minor fix ups
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderview committed Aug 14, 2020
1 parent 1317558 commit 5b53aa3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

A [=/service worker registration=] has an associated <dfn export id="dfn-origin">origin</dfn>, an [=environment settings object/origin=].

A [=/service worker registration=] has an associated <dfn export id="dfn-id">id</dfn>.
A [=/service worker registration=] has an associated <dfn export id="dfn-id">id</dfn>, a [=string=].

A [=/service worker registration=] has an associated <dfn export id="dfn-installing-worker">installing worker</dfn> (a [=/service worker=] or null) whose [=service worker/state=] is "`installing`". It is initially set to null.

Expand Down Expand Up @@ -593,9 +593,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

1, Let |oldestWorker| be the result of running [=Get Oldest Worker=] passing |registration| as the argument.
1. If |oldestWorker| is null, then:
1. Return null.
1. Else:
1. Return |oldestWorker|'s [=service worker/scope url=].
1. Return null.
1. Return |oldestWorker|'s [=service worker/scope url=].

<div class="example">
In the example in [[#service-worker-url]], the value of <code>registration.scope</code>, obtained from <code>navigator.serviceWorker.ready.then(registration => console.log(registration.scope))</code> for example, will be "<code>https://example.com/</code>".
Expand All @@ -618,7 +617,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
1. If |newestWorker| is null, return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}} and abort these steps.
1. If [=this=]'s [=relevant global object=] |globalObject| is a {{ServiceWorkerGlobalScope}} object, and |globalObject|'s associated [=ServiceWorkerGlobalScope/service worker=]'s <a>state</a> is "`installing`", return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}} and abort these steps.
1. Let |promise| be a <a>promise</a>.
1. Let |job| be the result of running <a>Create Job</a> with *update*, |registration|'s [=service worker registration/origin=], [=service worker registration/id=], null, |newestWorker|'s [=service worker/script url=], |promise|, and the [=this=]'s <a>relevant settings object</a>.
1. Let |job| be the result of running <a>Create Job</a> with *update*, |registration|'s [=service worker registration/origin=], [=service worker registration/id=], null, |newestWorker|'s [=service worker/script url=], |promise|, and [=this=]'s <a>relevant settings object</a>.
1. Set |job|'s <a>worker type</a> to |newestWorker|'s [=service worker/type=].
1. Invoke <a>Schedule Job</a> with |job|.
1. Return |promise|.
Expand All @@ -634,7 +633,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
1. Let |promise| be [=a new promise=].
1. Let |newestWorker| be the result of running <a>Get Newest Worker</a> algorithm passing |registration| as its argument.
1. If |newestWorker| is null, return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}} and abort these steps.
1. Let |job| be the result of running [=Create Job=] with *unregister*, the [=service worker registration/origin=], [=service worker registration/id=] of the [=ServiceWorkerRegistration/service worker registration=], null, null, |promise|, and the [=this=]'s <a>relevant settings object</a>.
1. Let |job| be the result of running [=Create Job=] with *unregister*, the [=service worker registration/origin=], [=service worker registration/id=] of the [=ServiceWorkerRegistration/service worker registration=], null, null, |promise|, and [=this=]'s <a>relevant settings object</a>.
1. Invoke <a>Schedule Job</a> with |job|.
1. Return |promise|.
</section>
Expand Down Expand Up @@ -758,10 +757,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
1. Let |client| be [=this=]'s [=ServiceWorkerContainer/service worker client=].
1. Let |scriptURL| be the result of <a lt="URL parser">parsing</a> |scriptURL| with [=this=]'s <a>relevant settings object</a>'s <a>API base URL</a>.
1. Let |scopeURL| be null.
1. If |options|.{{RegistrationOptions/scope}} is <a>present</a>, set |scopeURL| to the result of <a lt="URL parser">parsing</a> |options|.{{RegistrationOptions/scope}} with the [=this=]'s <a>relevant settings object</a>'s <a>API base URL</a>.
1. If |options|["{{RegistrationOptions/scope}}"] is <a>present</a>, set |scopeURL| to the result of <a lt="URL parser">parsing</a> |options|["{{RegistrationOptions/scope}}"] with the [=this=]'s <a>relevant settings object</a>'s <a>API base URL</a>.
1. Let |id| be null.
1. If |options|.{{RegistrationOptions/id} is <a>present</a>, set |id| to |options|.{{RegistrationOptions/id}}.
1. Invoke [=Start Register=] with |id|, |scopeURL|, |scriptURL|, |p|, |client|, |client|'s <a>creation URL</a>, |options|.{{RegistrationOptions/type}}, and |options|.{{RegistrationOptions/updateViaCache}}.
1. If |options|.{{RegistrationOptions/id} is <a>present</a>, set |id| to |options|["{{RegistrationOptions/id}}"].
1. Invoke [=Start Register=] with |id|, |scopeURL|, |scriptURL|, |p|, |client|, |client|'s <a>creation URL</a>, |options|["{{RegistrationOptions/type}}"], and |options|["{{RegistrationOptions/updateViaCache}}"].
1. Return |p|.
</section>

Expand Down

0 comments on commit 5b53aa3

Please sign in to comment.