Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing some spec linking issues #1640

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
Otherwise, if the created [=document=]'s [=/origin=] is an [=opaque origin=] or not the [=same origin|same=] as its creator [=document=]'s [=/origin=], the [=window client=]'s [=active service worker=] is set to null.
Otherwise, it is set to the creator [=document=]'s [=/service worker client=]'s [=active service worker=].

Note: For an initial [=navigate|navigation=] with [=replacement enabled=], the initial [=window client=] that was [created](https://html.spec.whatwg.org/#set-up-a-window-environment-settings-object) when the [=/browsing context=] was [created](https://html.spec.whatwg.org/#creating-a-new-browsing-context) is reused, but the [=active service worker=] is determined by the same behavior as above.
Note: For an initial [=navigate|navigation=] with a <a spec="html">history handling behavior</a> value of [replace](https://html.spec.whatwg.org/#hh-replace), the initial [=window client=] that was [created](https://html.spec.whatwg.org/#set-up-a-window-environment-settings-object) when the [=/browsing context=] was [created](https://html.spec.whatwg.org/#creating-a-new-browsing-context) is reused, but the [=active service worker=] is determined by the same behavior as above.

Note: <a element-attr for=iframe lt=sandbox>Sandboxed</a> <{iframe}>s without the sandboxing directives, `allow-same-origin` and `allow-scripts`, result in having the [=active service worker=] value of null as their [=/origin=] is an [=opaque origin=].
</section>
Expand Down Expand Up @@ -408,7 +408,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/

A {{ServiceWorker}} object represents a [=/service worker=]. Each {{ServiceWorker}} object is associated with a [=/service worker=]. Multiple separate objects implementing the {{ServiceWorker}} interface across documents and workers can all be associated with the same [=/service worker=] simultaneously.

A {{ServiceWorker}} object has an associated {{ServiceWorkerState}} object which is itself associated with [=/service worker=]'s <a>state</a>.
A {{ServiceWorker}} object has an associated {{ServiceWorkerState}} object which is itself associated with [=/service worker=]'s [=service worker/state=].

<section>
<h4 id="service-worker-creation">Getting {{ServiceWorker}} instances</h4>
Expand Down Expand Up @@ -465,7 +465,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
The <dfn method for="ServiceWorker"><code>postMessage(|message|, |options|)</code></dfn> method steps are:

1. Let |serviceWorker| be the [=/service worker=] represented by [=this=].
1. Let |incumbentSettings| be the [=incumbent settings object=].
1. Let |incumbentSettings| be the <a spec="html">incumbent settings object</a>.
1. Let |incumbentGlobal| be |incumbentSettings|'s [=environment settings object/global object=].
1. Let |serializeWithTransferResult| be <a abstract-op>StructuredSerializeWithTransfer</a>(|message|, |options|["{{StructuredSerializeOptions/transfer}}"]). Rethrow any exceptions.
1. If the result of running the [=Should Skip Event=] algorithm with "message" and |serviceWorker| is true, then return.
Expand Down Expand Up @@ -625,7 +625,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Let |registration| be the [=ServiceWorkerRegistration/service worker registration=].
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. 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. If [=this=]'s [=relevant global object=] |globalObject| is a {{ServiceWorkerGlobalScope}} object, and |globalObject|'s associated [=ServiceWorkerGlobalScope/service worker=]'s [=service worker/state=] 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/storage key=], |registration|'s [=service worker registration/scope url=], |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=].
Expand Down Expand Up @@ -1426,7 +1426,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Run these substeps <a>in parallel</a>:
1. Let |newContext| be a new [=top-level browsing context=].
1. [=Queue a task=] to run the following steps on |newContext|'s {{Window}} object's [=environment settings object=]'s [=responsible event loop=] using the [=user interaction task source=]:
1. *HandleNavigate*: [=Navigate=] |newContext| to |url| with [=exceptions enabled flag|exceptions enabled=] and [=replacement enabled=].
1. *HandleNavigate*: [=Navigate=] |newContext| to |url| with [=exceptions enabled flag|exceptions enabled=] and <a spec="html">history handling behavior</a> set to [replace](https://html.spec.whatwg.org/#hh-replace).
1. If the algorithm steps invoked in the step labeled *HandleNavigate* [=throws=] an exception, [=queue a task=] to reject |promise| with the exception, on |serviceWorkerEventLoop| using the [=DOM manipulation task source=], and abort these steps.
1. Let |frameType| be the result of running [=Get Frame Type=] with |newContext|.
1. Let |visibilityState| be |newContext|'s <a>active document</a>'s {{Document/visibilityState}} attribute value.
Expand Down Expand Up @@ -2267,7 +2267,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Let |serviceWorker| be |request|'s [=request/client=]'s [=environment settings object/global object=]'s [=ServiceWorkerGlobalScope/service worker=].
1. Let |map| be |serviceWorker|'s [=script resource map=].
1. Let |url| be |request|'s [=request/url=].
1. If |serviceWorker|'s [=state=] is not "`parsed`" or "`installing`":
1. If |serviceWorker|'s [=service worker/state=] is not "`parsed`" or "`installing`":
1. Return |map|[|url|] if it [=map/exists=] and a [=network error=] otherwise.
1. If |map|[|url|] [=map/exists=]:
1. [=set/Append=] |url| to |serviceWorker|'s [=set of used scripts=].
Expand Down Expand Up @@ -2895,7 +2895,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
:: None

1. If |registration|'s [=waiting worker=] is null, return.
1. If |registration|'s [=active worker=] is not null and |registration|'s [=active worker=]'s [=state=] is "`activating`", return.
1. If |registration|'s [=active worker=] is not null and |registration|'s [=active worker=]'s [=service worker/state=] is "`activating`", return.

Note: If the existing active worker is still in activating state, the activation of the waiting worker is delayed.

Expand All @@ -2917,7 +2917,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/

1. Let |unsafeCreationTime| be the [=unsafe shared current time=].
1. If |serviceWorker| is [=running=], then return |serviceWorker|'s [=start status=].
1. If |serviceWorker|'s [=state=] is "`redundant`", then return *failure*.
1. If |serviceWorker|'s [=service worker/state=] is "`redundant`", then return *failure*.
1. Assert: |serviceWorker|'s [=start status=] is null.
1. Let |script| be |serviceWorker|'s [=service worker/script resource=].
1. Assert: |script| is not null.
Expand Down Expand Up @@ -3049,7 +3049,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. [=header list/Append=] to |preloadRequestHeaders| a new [=header=] whose [=header/name=] is \`<code>Service-Worker-Navigation-Preload</code>\` and [=header/value=] is |registration|'s [=navigation preload header value=].
1. Set |preloadRequest|'s [=service-workers mode=] to "`none`".
1. Let |preloadFetchController| be null.
1. Run the following substeps [=in parallel=], but [=abort when=] |controller|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
1. Run the following substeps [=in parallel=], but [=abort when=] |controller|'s <a spec="fetch">state</a> is "<code>terminated</code>" or "<code>aborted</code>":
1. Set |preloadFetchController| to the result of [=Fetch|fetching=] |preloadRequest|.

To [=process response=] for |navigationPreloadResponse|, run these substeps:
Expand All @@ -3074,7 +3074,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Return null.
1. If |useHighResPerformanceTimers| is true, then set |useHighResPerformanceTimers| to |activeWorker|'s [=service worker/global object=]'s [=WorkerGlobalScope/cross-origin isolated capability=].
1. Let |timingInfo|'s [=service worker timing info/start time=] be the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
1. If |activeWorker|'s <a>state</a> is "`activating`", wait for |activeWorker|'s <a>state</a> to become "`activated`".
1. If |activeWorker|'s [=service worker/state=] is "`activating`", wait for |activeWorker|'s [=service worker/state=] to become "`activated`".
1. If the result of running the [=Run Service Worker=] algorithm with |activeWorker| is *failure*, then set |handleFetchFailed| to true.
1. Else:
1. Set |workerRealm| to the [=relevant realm=] of the |activeWorker|'s [=service worker/global object=].
Expand Down Expand Up @@ -3103,7 +3103,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Else, [=ReadableStream/cancel=] |request|'s [=request/body=] with undefined.
1. If |response| is not null, then set |response|'s [=response/service worker timing info=] to |timingInfo|.
1. If |e|'s <a>canceled flag</a> is set, set |eventCanceled| to true.
1. If |controller| [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>", then [=queue a task=] to [=AbortSignal/signal abort=] on |requestObject|'s {{Request/signal}}.
1. If |controller| <a spec="fetch">state</a> is "<code>terminated</code>" or "<code>aborted</code>", then [=queue a task=] to [=AbortSignal/signal abort=] on |requestObject|'s {{Request/signal}}.

If |task| is discarded, set |handleFetchFailed| to true.

Expand Down Expand Up @@ -3155,7 +3155,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. If the result of running [=Should Skip Event=] with |eventName| and |activeWorker| is true, then:
1. If |registration| is [=stale=], then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
2. Return.
1. If |activeWorker|'s [=state=] is "`activating`", wait for |activeWorker|'s [=state=] to become "`activated`".
1. If |activeWorker|'s [=service worker/state=] is "`activating`", wait for |activeWorker|'s [=service worker/state=] to become "`activated`".
1. If the result of running the [=Run Service Worker=] algorithm with |activeWorker| is *failure*, then:
1. If |registration| is [=stale=], then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
2. Return.
Expand Down