Skip to content

Commit d64ffd5

Browse files
authored
Define the time origin for service workers (#1621)
In [this HTML PR](whatwg/html#7339) we add a `time origin` getter to the `environment settings object`. We need to account for that value in service workers, which would be the time the worker environment is created.
1 parent 9c7a50f commit d64ffd5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/index.bs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,6 +2895,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
28952895

28962896
Note: This algorithm blocks until the service worker is [=running=] or fails to start.
28972897

2898+
1. Let |unsafeCreationTime| be the [=unsafe shared current time=].
28982899
1. If |serviceWorker| is [=running=], then return |serviceWorker|'s [=start status=].
28992900
1. If |serviceWorker|'s [=state=] is "`redundant`", then return *failure*.
29002901
1. Assert: |serviceWorker|'s [=start status=] is null.
@@ -2919,6 +2920,8 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
29192920
:: Return its registering [=/service worker client=]'s [=environment settings object/origin=].
29202921
: The [=environment settings object/policy container=]
29212922
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/policy container=].
2923+
: The [=environment settings object/time origin=]
2924+
:: Return the result of [=coarsen time|coarsening=] |unsafeCreationTime| given |workerGlobalScope|'s [=WorkerGlobalScope/cross-origin isolated capability=].
29222925

29232926
1. Set |settingsObject|'s [=environment/id=] to a new unique opaque string, [=creation URL=] to |serviceWorker|'s [=service worker/script url=], [=environment/top-level creation URL=] to null, [=environment/top-level origin=] to an [=implementation-defined=] value, [=environment/target browsing context=] to null, and [=active service worker=] to null.
29242927
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/url=] to |serviceWorker|'s [=service worker/script url=].

0 commit comments

Comments
 (0)