diff --git a/spec/service_worker/index.bs b/spec/service_worker/index.bs index b2bf72ca..7fcad47a 100644 --- a/spec/service_worker/index.bs +++ b/spec/service_worker/index.bs @@ -61,8 +61,6 @@ spec: html; type: dfn text: browsing context text: discard a document text: document base url - text: effective script origin - text: entry settings object text: environment settings object text: event handler text: event handler event type @@ -212,7 +210,7 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/ text: origin; for: resource; url: origin-2 text: browsing context is discarded urlPrefix: infrastructure.html - text: read only array; url: dfn-read-only-array + text: inserted into a document; url: insert-an-element-into-a-document text: StructuredCloneWithTransfer urlPrefix: interaction.html text: has focus steps @@ -784,9 +782,9 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  1. Let p be a promise.
  2. Let client be the context object's service worker client.
  3. -
  4. Let scriptURL be the result of parsing scriptURL with entry settings object's API base URL.
  5. +
  6. Let scriptURL be the result of parsing scriptURL with the context object's relevant settings object's API base URL.
  7. Let scopeURL be null.
  8. -
  9. If options.{{RegistrationOptions/scope}} is present, set scopeURL to options.{{RegistrationOptions/scope}}.
  10. +
  11. If options.{{RegistrationOptions/scope}} is present, set scopeURL to the result of parsing options.{{RegistrationOptions/scope}} with the context object's relevant settings object's API base URL.
  12. Invoke [[#start-register-algorithm]] with scopeURL, scriptURL, p, client, client's creation URL and options.{{RegistrationOptions/type}}.
  13. Return p.
@@ -799,7 +797,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  1. Let client be the context object's service worker client.
  2. -
  3. Let clientURL be the result of parsing clientURL with entry settings object's API base URL.
  4. +
  5. Let clientURL be the result of parsing clientURL with the context object's relevant settings object's API base URL.
  6. If clientURL is failure, return a promise rejected with a TypeError.
  7. If the origin of clientURL is not client's origin, return a promise rejected with a "{{SecurityError}}" exception.
  8. Let promise be a new promise.
  9. @@ -2125,20 +2123,22 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  10. Let request be the request for which this header was received in the response.
  11. If request's client is not a secure context, abort these steps.
  12. Let scriptURL be the result of parsing the target IRI of the Link header.
  13. -
  14. Let scopeURL be the "scope" target attribute of the Link header, or null if no such attribute is present.
  15. +
  16. Let scopeURL null. +
  17. If the "scope" target attribute of the Link header is present, set scopeURL to the result of parsing the "scope" target attribute with scriptURL.
  18. Let workerType be the "workertype" target attribute of the Link header, or "classic" if no such attribute is present.
  19. If workerType is not a valid {{WorkerType}} value, abort these steps.
  20. Invoke [[#start-register-algorithm]] with scopeURL, scriptURL, a new promise, null, contextURL and workerType.
-

When a serviceworker link's <{link}> element is inserted into a document, a serviceworker link is created on a <{link}> element that is already in a Document, or the <{link/href}> or <{link/scope}> attributes of the <{link}> element of a serviceworker link is changed, the user agent should run these steps:

+

When a serviceworker link's <{link}> element is inserted into a document, a serviceworker link is created on a <{link}> element that is already in a document tree, or the <{link/href}> or <{link/scope}> attributes of the <{link}> element of a serviceworker link is changed, the user agent should run these steps:

  1. If the <{link/href}> attribute is the empty string, abort these steps.
  2. Let client be the document's service worker client.
  3. If client is not a secure context, queue a task to fire a simple event named error at the <{link}> element, and abort these steps.
  4. -
  5. Let scriptURL be the result of parsing the <{link/href}> attribute with document's document base URL.
  6. -
  7. Let scopeURL be the <{link/scope}> attribute, or null if the <{link/scope}> attribute is omitted.
  8. +
  9. Let scriptURL be the result of parsing the <{link/href}> attribute with the <{link}> element's node document's document base URL.
  10. +
  11. Let scopeURL null. +
  12. If the <{link/scope}> attribute is present, set scopeURL to the result of parsing the <{link/scope}> attribute with the <{link}> element's node document's document base URL.
  13. Let workerType be the <{link/workertype}> attribute, or "classic" if the <{link/workertype}> attribute is omitted.
  14. If workerType is not a valid {{WorkerType}} value, queue a task to fire a simple event named error at the <{link}> element, and abort these steps.
  15. Let promise be a new promise.
  16. @@ -2146,8 +2146,8 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  17. Run the following substeps in parallel:
    1. Wait until promise settles.
    2. -
    3. If promise rejected, queue a task to fire a simple event named error at the <{link}> element.
    4. -
    5. If promise resolved, queue a task to fire a simple event named load at the <{link}> element.
    6. +
    7. If promise rejects, queue a task to fire a simple event named error at the <{link}> element.
    8. +
    9. If promise fulfills, queue a task to fire a simple event named load at the <{link}> element.
@@ -3141,8 +3141,8 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
Input
-
scopeURLString, a string
-
scriptURL, a URL
+
scopeURL, a URL or failure or null
+
scriptURL, a URL or failure
promise, a promise
client, a service worker client
referrer, a URL
@@ -3154,11 +3154,9 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  • If scriptURL is failure, reject promise with a TypeError and abort these steps.
  • If scriptURL's scheme is not one of "http" and "https", reject promise with a TypeError and abort these steps.
  • If any of the strings in scriptURL's path contains either ASCII case-insensitive "%2f" or ASCII case-insensitive "%5c", reject promise with a TypeError and abort these steps.
  • -
  • Let scopeURL be null.
  • -
  • If scopeURLString is null, set scopeURL to the result of parsing a string "./" with scriptURL. +
  • If scopeURL is null, set scopeURL to the result of parsing the string "./" with scriptURL.

    The scope url for the registration is set to the location of the service worker script by default.

  • -
  • Else, set scopeURL to the result of parsing scopeURLString with entry settings object's API base URL.
  • If scopeURL is failure, reject promise with a TypeError and abort these steps.
  • If scopeURL's scheme is not one of "http" and "https", reject promise with a TypeError and abort these steps.
  • If any of the strings in scopeURL's path contains either ASCII case-insensitive "%2f" or ASCII case-insensitive "%5c", reject promise with a TypeError and abort these steps.
  • diff --git a/spec/service_worker/index.html b/spec/service_worker/index.html index cc36d349..8c752d98 100644 --- a/spec/service_worker/index.html +++ b/spec/service_worker/index.html @@ -2083,9 +2083,9 @@