From 2e2d872952176213ecbd6ec7657509ecaad12bd5 Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Fri, 19 Jul 2019 02:58:58 -0700 Subject: [PATCH] Leave notes on service worker script fetching for V1 (#1450) The Update algorithm step 9 has two issues: - Using to-be-created environment settings object instead of a concrete environment settings object - Passing null value of job's client to the fetch a script algorithms in HTML This change leaves notes on these issues to track them in the nightly version and moves them to the Version 2 milestone in the github repository. For https://github.com/w3c/ServiceWorker/issues/1013. --- docs/index.bs | 4 ++++ docs/v1/index.bs | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/docs/index.bs b/docs/index.bs index 0ca64ee6..9ddc8b7b 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -2526,6 +2526,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : "module" :: Fetch a module worker script graph given |job|’s serialized [=job/script url=], |job|’s [=job/client=], "serviceworker", "omit", and the to-be-created environment settings object for this service worker. + Issue: Using the to-be-created [=environment settings object=] rather than a concrete [=environment settings object=]. This is used due to the unique processing model of service workers compared to the processing model of other [=web workers=]. The script fetching algorithms of HTML standard originally designed for other [=web workers=] require an [=environment settings object=] of the execution environment, but service workers fetch a script separately in the [=Update=] algorithm before the script later runs multiple times through the [=Run Service Worker=] algorithm. + + Issue: The [=fetch a classic worker script=] algorithm and the [=fetch a module worker script graph=] algorithm in HTML take |job|’s [=job/client=] as an argument. |job|’s [=job/client=] is null when passed from the [=Soft Update=] algorithm. + To [=fetching scripts/perform the fetch=] given |request|, run the following steps: 1. Append \`Service-Worker\`/\`script\` to |request|'s [=request/header list=]. diff --git a/docs/v1/index.bs b/docs/v1/index.bs index 6ecce021..1c019e9d 100644 --- a/docs/v1/index.bs +++ b/docs/v1/index.bs @@ -2350,6 +2350,13 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : "module" :: Fetch a module worker script graph given |job|’s serialized [=job/script url=], |job|’s [=job/client=], "serviceworker", "omit", and the to-be-created environment settings object for this service worker. +
+

Note: This step has two known issues.

+

First, using the to-be-created [=environment settings object=] rather than a concrete [=environment settings object=]. This is used due to the unique processing model of service workers compared to the processing model of other [=web workers=]. The script fetching algorithms of HTML standard originally designed for other [=web workers=] require an [=environment settings object=] of the execution environment, but service workers fetch a script separately in the [=Update=] algorithm before the script later runs multiple times through the [=Run Service Worker=] algorithm.

+

Second, the [=fetch a classic worker script=] algorithm and the [=fetch a module worker script graph=] algorithm in HTML take |job|’s [=job/client=] as an argument. |job|’s [=job/client=] is null when passed from the [=Soft Update=] algorithm.

+

These issues are tracked in the [issue #1013](https://github.com/w3c/ServiceWorker/issues/1013) of the ServiceWorkers GitHub repository. We will address these issues in [Service Workers Nightly](https://w3c.github.io/ServiceWorker/).

+
+ To [=fetching scripts/perform the fetch=] given |request|, run the following steps: 1. Append \`Service-Worker\`/\`script\` to |request|'s [=request/header list=].