From ddf95c39a41bd532c2672780e4ba8df0ebf8b41d Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Thu, 1 Dec 2016 20:47:53 +0900 Subject: [PATCH] Fix autolinks to job's fields --- docs/index.bs | 42 ++++++++++---------- docs/index.html | 98 ++++++++++++++++++++++++---------------------- docs/v1/index.bs | 42 ++++++++++---------- docs/v1/index.html | 98 ++++++++++++++++++++++++---------------------- 4 files changed, 144 insertions(+), 136 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 516fd9d3..f033f7a4 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -2252,10 +2252,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe Two jobs are equivalent when their job type is the same and: - * For *register* and *update* jobs, both their [=service worker registration/scope url=] and the [=service worker/script url=] are the same. - * For *unregister* jobs, their [=service worker registration/scope url=] is the same. + * For *register* and *update* jobs, both their [=job/scope url=] and the [=job/script url=] are the same. + * For *unregister* jobs, their [=job/scope url=] is the same. - A job queue is a thread safe queue used to synchronize the set of concurrent jobs. The job queue contains jobs as its elements. The job queue *should* satisfy the general properties of FIFO queue. A user agent *must* maintain a separate job queue for each [=/service worker registration=] keyed by its [=service worker registration/scope url=]. A job queue is initially empty. Unless stated otherwise, the job queue referenced from the algorithm steps is a job queue for the job's [=service worker registration/scope url=]. + A job queue is a thread safe queue used to synchronize the set of concurrent jobs. The job queue contains jobs as its elements. The job queue *should* satisfy the general properties of FIFO queue. A user agent *must* maintain a separate job queue for each [=/service worker registration=] keyed by its [=service worker registration/scope url=]. A job queue is initially empty. Unless stated otherwise, the job queue referenced from the algorithm steps is a job queue for the job's [=job/scope url=].

Create Job

@@ -2392,24 +2392,24 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : Output :: none - 1. If the result of running potentially trustworthy origin with the [=environment settings object/origin=] of |job|'s [=service worker/script url=] as the argument is Not Trusted, then: + 1. If the result of running potentially trustworthy origin with the [=environment settings object/origin=] of |job|'s [=job/script url=] as the argument is Not Trusted, then: 1. Invoke Reject Job Promise with |job| and a "{{SecurityError}}" exception. 1. Invoke Finish Job with |job| and abort these steps. - 1. If the [=environment settings object/origin=] of |job|'s [=service worker/script url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then: + 1. If the [=environment settings object/origin=] of |job|'s [=job/script url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then: 1. Invoke Reject Job Promise with |job| and a "{{SecurityError}}" exception. 1. Invoke Finish Job with |job| and abort these steps. - 1. If the [=environment settings object/origin=] of |job|'s [=service worker registration/scope url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then: + 1. If the [=environment settings object/origin=] of |job|'s [=job/scope url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then: 1. Invoke Reject Job Promise with |job| and a "{{SecurityError}}" exception. 1. Invoke Finish Job with |job| and abort these steps. - 1. Let |registration| be the result of running the Get Registration algorithm passing |job|'s [=service worker registration/scope url=] as the argument. + 1. Let |registration| be the result of running the Get Registration algorithm passing |job|'s [=job/scope url=] as the argument. 1. If |registration| is not null, then: 1. If |registration|'s uninstalling flag is set, unset it. 1. Let |newestWorker| be the result of running the Get Newest Worker algorithm passing |registration| as the argument. - 1. If |newestWorker| is not null and |job|'s [=service worker/script url=] [=url/equals=] |newestWorker|'s [=service worker/script url=] with the *exclude fragments flag* set, then: - 1. Invoke Resolve Job Promise with |job| and the {{ServiceWorkerRegistration}} object which represents |registration|. - 1. Invoke Finish Job with |job| and abort these steps. + 1. If |newestWorker| is not null and |job|'s [=job/script url=] [=url/equals=] |newestWorker|'s [=service worker/script url=] with the *exclude fragments flag* set, then: + 1. Invoke Resolve Job Promise with |job| and the {{ServiceWorkerRegistration}} object which represents |registration|. + 1. Invoke Finish Job with |job| and abort these steps. 1. Else: - 1. Invoke Set Registration algorithm passing |job|'s [=service worker registration/scope url=] as its argument. + 1. Invoke Set Registration algorithm passing |job|'s [=job/scope url=] as its argument. 1. Invoke Update algorithm passing |job| as the argument.
@@ -2421,12 +2421,12 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : Output :: none - 1. Let |registration| be the result of running the Get Registration algorithm passing |job|'s [=service worker registration/scope url=] as the argument. + 1. Let |registration| be the result of running the Get Registration algorithm passing |job|'s [=job/scope url=] as the argument. 1. If |registration| is null or |registration|'s uninstalling flag is set, then: 1. Invoke Reject Job Promise with |job| and a TypeError. 1. Invoke Finish Job with |job| and abort these steps. 1. Let |newestWorker| be the result of running Get Newest Worker algorithm passing |registration| as the argument. - 1. If |job|'s job type is *update*, and |newestWorker|'s [=service worker/script url=] does not [=url/equal=] |job|'s [=service worker/script url=] with the *exclude fragments flag* set, then: + 1. If |job|'s job type is *update*, and |newestWorker|'s [=service worker/script url=] does not [=url/equal=] |job|'s [=job/script url=] with the *exclude fragments flag* set, then: 1. Invoke Reject Job Promise with |job| and a TypeError. 1. Invoke Finish Job with |job| and abort these steps. 1. Let |httpsState| be "none". @@ -2434,9 +2434,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Switching on |job|'s worker type, run these substeps with the following options: : "classic" - :: Fetch a classic worker script given |job|’s serialized [=service worker/script url=], |job|’s [=job/client=], "serviceworker", and the to-be-created environment settings object for this service worker. + :: Fetch a classic worker script given |job|’s serialized [=job/script url=], |job|’s [=job/client=], "serviceworker", and the to-be-created environment settings object for this service worker. : "module" - :: Fetch a module worker script graph given |job|’s serialized [=service worker/script url=], |job|’s [=job/client=], "serviceworker", "omit", and the to-be-created environment settings object for this service worker. + :: 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. To [=fetching scripts/perform the fetch=] given |request|, run the following steps if the [=fetching scripts/is top-level=] flag is set: @@ -2465,9 +2465,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Let |scopeURL| be |registration|'s [=service worker registration/scope url=]. 1. Let |maxScopeString| be null. 1. If |serviceWorkerAllowed| is null, then: - 1. Set |maxScopeString| to "/" concatenated with the strings, except the last string that denotes the script's file name, in |job|'s [=service worker/script url=]'s [=url/path=] (including empty strings), separated from each other by "/". + 1. Set |maxScopeString| to "/" concatenated with the strings, except the last string that denotes the script's file name, in |job|'s [=job/script url=]'s [=url/path=] (including empty strings), separated from each other by "/". 1. Else: - 1. Let |maxScope| be the result of parsing |serviceWorkerAllowed| with |job|'s [=service worker/script url=]. + 1. Let |maxScope| be the result of parsing |serviceWorkerAllowed| with |job|'s [=job/script url=]. 1. Set |maxScopeString| to "/" concatenated with the strings in |maxScope|'s [=url/path=] (including empty strings), separated from each other by "/". 1. Let |scopeString| be "/" concatenated with the strings in |scopeURL|'s [=url/path=] (including empty strings), separated from each other by "/". 1. If |scopeString| starts with |maxScopeString|, do nothing. @@ -2491,13 +2491,13 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe Else, continue the rest of these steps after the algorithm's asynchronous completion, with |script| being the asynchronous completion value. - 1. If |newestWorker| is not null, |newestWorker|'s [=service worker/script url=] [=url/equals=] |job|'s [=service worker/script url=] with the *exclude fragments flag* set, and |script| is a byte-for-byte match with |newestWorker|'s script resource, then: + 1. If |newestWorker| is not null, |newestWorker|'s [=service worker/script url=] [=url/equals=] |job|'s [=job/script url=] with the *exclude fragments flag* set, and |script| is a byte-for-byte match with |newestWorker|'s script resource, then: 1. Invoke Resolve Job Promise with |job| and the {{ServiceWorkerRegistration}} object which represents |registration|. 1. Invoke Finish Job with |job| and abort these steps. 1. Else: 1. Let |worker| be a new [=/service worker=]. 1. Generate a unique opaque string and set |worker|'s id to the value. - 1. Set |worker|'s [=service worker/script url=] to |job|'s [=service worker/script url=], |worker|'s script resource to |script|, and |worker|'s type to |job|'s worker type. + 1. Set |worker|'s [=service worker/script url=] to |job|'s [=job/script url=], |worker|'s script resource to |script|, and |worker|'s type to |job|'s worker type. 1. Set |worker|'s script resource's HTTPS state to |httpsState|. 1. Set |worker|'s script resource's [=script resource/referrer policy=] to |referrerPolicy|. 1. Invoke Run Service Worker algorithm with |worker| as the argument. @@ -2962,10 +2962,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : Output :: none - 1. If the [=environment settings object/origin=] of |job|'s [=service worker registration/scope url=] is not |job|'s [=job/client=]'s [=environment settings object/origin=], then: + 1. If the [=environment settings object/origin=] of |job|'s [=job/scope url=] is not |job|'s [=job/client=]'s [=environment settings object/origin=], then: 1. Invoke Reject Job Promise with |job| and a "{{SecurityError}}" exception. 1. Invoke Finish Job with |job| and abort these steps. - 1. Let |registration| be the result of running Get Registration algorithm passing |job|'s [=service worker registration/scope url=] as the argument. + 1. Let |registration| be the result of running Get Registration algorithm passing |job|'s [=job/scope url=] as the argument. 1. If |registration| is null, then: 1. Invoke Resolve Job Promise with |job| and false. 1. Invoke Finish Job with |job| and abort these steps. diff --git a/docs/index.html b/docs/index.html index 2e917fea..6da3221c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4380,11 +4380,11 @@

Appendix A: Al

Two jobs are equivalent when their job type is the same and:

-

A job queue is a thread safe queue used to synchronize the set of concurrent jobs. The job queue contains jobs as its elements. The job queue should satisfy the general properties of FIFO queue. A user agent must maintain a separate job queue for each service worker registration keyed by its scope url. A job queue is initially empty. Unless stated otherwise, the job queue referenced from the algorithm steps is a job queue for the job’s scope url.

+

A job queue is a thread safe queue used to synchronize the set of concurrent jobs. The job queue contains jobs as its elements. The job queue should satisfy the general properties of FIFO queue. A user agent must maintain a separate job queue for each service worker registration keyed by its scope url. A job queue is initially empty. Unless stated otherwise, the job queue referenced from the algorithm steps is a job queue for the job’s scope url.

Create Job

@@ -4411,9 +4411,9 @@

Set job’s job type to jobType.

  • -

    Set job’s scope url to scopeURL.

    +

    Set job’s scope url to scopeURL.

  • -

    Set job’s script url to scriptURL.

    +

    Set job’s script url to scriptURL.

  • Set job’s job promise to promise.

  • @@ -4618,7 +4618,7 @@

    1. -

      If the result of running potentially trustworthy origin with the origin of job’s script url as the argument is Not Trusted, then:

      +

      If the result of running potentially trustworthy origin with the origin of job’s script url as the argument is Not Trusted, then:

      1. Invoke Reject Job Promise with job and a "SecurityError" exception.

        @@ -4626,7 +4626,7 @@

        Invoke Finish Job with job and abort these steps.

    2. -

      If the origin of job’s script url is not job’s referrer's origin, then:

      +

      If the origin of job’s script url is not job’s referrer's origin, then:

      1. Invoke Reject Job Promise with job and a "SecurityError" exception.

        @@ -4634,7 +4634,7 @@

        Invoke Finish Job with job and abort these steps.

    3. -

      If the origin of job’s scope url is not job’s referrer's origin, then:

      +

      If the origin of job’s scope url is not job’s referrer's origin, then:

      1. Invoke Reject Job Promise with job and a "SecurityError" exception.

        @@ -4642,7 +4642,7 @@

        Invoke Finish Job with job and abort these steps.

    4. -

      Let registration be the result of running the Get Registration algorithm passing job’s scope url as the argument.

      +

      Let registration be the result of running the Get Registration algorithm passing job’s scope url as the argument.

    5. If registration is not null, then:

        @@ -4651,7 +4651,7 @@

        Let newestWorker be the result of running the Get Newest Worker algorithm passing registration as the argument.

      1. -

        If newestWorker is not null and job’s script url equals newestWorker’s script url with the exclude fragments flag set, then:

        +

        If newestWorker is not null and job’s script url equals newestWorker’s script url with the exclude fragments flag set, then:

        1. Invoke Resolve Job Promise with job and the ServiceWorkerRegistration object which represents registration.

          @@ -4663,7 +4663,7 @@

          Else:

          1. -

            Invoke Set Registration algorithm passing job’s scope url as its argument.

            +

            Invoke Set Registration algorithm passing job’s scope url as its argument.

        2. Invoke Update algorithm passing job as the argument.

          @@ -4683,7 +4683,7 @@

          1. -

            Let registration be the result of running the Get Registration algorithm passing job’s scope url as the argument.

            +

            Let registration be the result of running the Get Registration algorithm passing job’s scope url as the argument.

          2. If registration is null or registration’s uninstalling flag is set, then:

              @@ -4695,7 +4695,7 @@

              Let newestWorker be the result of running Get Newest Worker algorithm passing registration as the argument.

            1. -

              If job’s job type is update, and newestWorker’s script url does not equal job’s script url with the exclude fragments flag set, then:

              +

              If job’s job type is update, and newestWorker’s script url does not equal job’s script url with the exclude fragments flag set, then:

              1. Invoke Reject Job Promise with job and a TypeError.

                @@ -4712,11 +4712,11 @@

                "classic"

                -

                Fetch a classic worker script given job’s serialized script url, job’s client, "serviceworker", and the to-be-created environment settings object for this service worker.

                +

                Fetch a classic worker script given job’s serialized script url, job’s client, "serviceworker", and the to-be-created environment settings object for this service worker.

                "module"

                -

                Fetch a module worker script graph given job’s serialized script url, job’s client, "serviceworker", "omit", and the to-be-created environment settings object for this service worker.

                +

                Fetch a module worker script graph given job’s serialized script url, job’s client, "serviceworker", "omit", and the to-be-created environment settings object for this service worker.

  • To perform the fetch given request, run the following steps if the is top-level flag is set:

      @@ -4756,20 +4756,20 @@

      Asynchronously complete these steps with a network error.

  • -

    Let scopeURL be registration’s scope url.

    +

    Let scopeURL be registration’s scope url.

  • Let maxScopeString be null.

  • If serviceWorkerAllowed is null, then:

    1. -

      Set maxScopeString to "/" concatenated with the strings, except the last string that denotes the script’s file name, in job’s script url's path (including empty strings), separated from each other by "/".

      +

      Set maxScopeString to "/" concatenated with the strings, except the last string that denotes the script’s file name, in job’s script url's path (including empty strings), separated from each other by "/".

  • Else:

    1. -

      Let maxScope be the result of parsing serviceWorkerAllowed with job’s script url.

      +

      Let maxScope be the result of parsing serviceWorkerAllowed with job’s script url.

    2. Set maxScopeString to "/" concatenated with the strings in maxScope’s path (including empty strings), separated from each other by "/".

    @@ -4803,7 +4803,7 @@

    Else, continue the rest of these steps after the algorithm’s asynchronous completion, with script being the asynchronous completion value.

  • -

    If newestWorker is not null, newestWorker’s script url equals job’s script url with the exclude fragments flag set, and script is a byte-for-byte match with newestWorker’s script resource, then:

    +

    If newestWorker is not null, newestWorker’s script url equals job’s script url with the exclude fragments flag set, and script is a byte-for-byte match with newestWorker’s script resource, then:

    1. Invoke Resolve Job Promise with job and the ServiceWorkerRegistration object which represents registration.

      @@ -4818,7 +4818,7 @@

      Generate a unique opaque string and set worker’s id to the value.

    2. -

      Set worker’s script url to job’s script url, worker’s script resource to script, and worker’s type to job’s worker type.

      +

      Set worker’s script url to job’s script url, worker’s script resource to script, and worker’s type to job’s worker type.

    3. Set worker’s script resource’s HTTPS state to httpsState.

    4. @@ -4862,7 +4862,7 @@

      If newestWorker is null, abort these steps.

    5. -

      Let job be the result of running Create Job with update, registration’s scope url, newestWorker’s script url, null, and null.

      +

      Let job be the result of running Create Job with update, registration’s scope url, newestWorker’s script url, null, and null.

    6. Set job’s worker type to newestWorker’s type.

    7. @@ -4903,7 +4903,7 @@

      Invoke Resolve Job Promise with job and the ServiceWorkerRegistration object which represents registration.

    8. -

      Queue a task to fire an event named updatefound at all the ServiceWorkerRegistration objects for all the service worker clients whose creation URL matches registration’s scope url and all the service workers whose containing service worker registration is registration.

      +

      Queue a task to fire an event named updatefound at all the ServiceWorkerRegistration objects for all the service worker clients whose creation URL matches registration’s scope url and all the service workers whose containing service worker registration is registration.

    9. Let installingWorker be registration’s installing worker.

    10. @@ -5022,7 +5022,7 @@

      If redundantWorker is not null, run the Update Worker State algorithm passing redundantWorker and redundant as the arguments.

    11. -

      For each service worker client client whose creation URL matches registration’s scope url:

      +

      For each service worker client client whose creation URL matches registration’s scope url:

      1. If client is a window client, unassociate client’s responsible document from its application cache, if it has one.

        @@ -5123,7 +5123,7 @@

        The API base URL

        -

        Return serviceWorker’s script url.

        +

        Return serviceWorker’s script url.

        The origin

        @@ -5138,7 +5138,7 @@

        HTTPS state.

      2. -

        Set workerGlobalScope’s url to serviceWorker’s script url.

        +

        Set workerGlobalScope’s url to serviceWorker’s script url.

      3. Set workerGlobalScope’s HTTPS state to serviceWorker’s script resource’s HTTPS state.

      4. @@ -5665,7 +5665,7 @@

        1. -

          If the origin of job’s scope url is not job’s client's origin, then:

          +

          If the origin of job’s scope url is not job’s client's origin, then:

          1. Invoke Reject Job Promise with job and a "SecurityError" exception.

            @@ -5673,7 +5673,7 @@

            Invoke Finish Job with job and abort these steps.

        2. -

          Let registration be the result of running Get Registration algorithm passing job’s scope url as the argument.

          +

          Let registration be the result of running Get Registration algorithm passing job’s scope url as the argument.

        3. If registration is null, then:

            @@ -5711,7 +5711,7 @@

            Let scopeString be serialized scope with the exclude fragment flag set.

          1. -

            Let registration be a new service worker registration whose scope url is set to scope.

            +

            Let registration be a new service worker registration whose scope url is set to scope.

          2. Set scope to registration map[scopeString] to registration.

          3. @@ -5778,7 +5778,7 @@

            Update Worker State algorithm passing redundantWorker and redundant as the arguments.

        4. -

          Let scopeString be serialized registration’s scope url with the exclude fragment flag set.

          +

          Let scopeString be serialized registration’s scope url with the exclude fragment flag set.

        5. Remove scope to registration map[scopeString].

        @@ -6347,7 +6347,7 @@

        `Service-Worker-Allowed`

        -

        Indicates the user agent will override the path restriction, which limits the maximum allowed scope url that the script can control, to the given value.

        +

        Indicates the user agent will override the path restriction, which limits the maximum allowed scope url that the script can control, to the given value.

        Note: The value is a URL. If a relative URL is given, it is parsed against the script’s URL.

        @@ -7557,11 +7557,10 @@

        3.1.1. scriptURL
      5. 3.2.5. update() -
      6. Appendix A: Algorithms -
      7. Register (2) (3) (4) -
      8. Update (2) (3) (4) (5) (6) (7) (8) (9) (10) -
      9. Soft Update -
      10. Run Service Worker (2) +
      11. Register +
      12. Update (2) (3) +
      13. Soft Update +
      14. Run Service Worker (2)