|
1177 | 1177 | }
|
1178 | 1178 | }
|
1179 | 1179 | </style>
|
1180 |
| - <meta content="Bikeshed 1.0.0" name="generator"> |
| 1180 | + <meta content="Bikeshed version 645534c1532bca4fdb4f3859efc66268a218d7c8" name="generator"> |
1181 | 1181 | <style>/* style-md-lists */
|
1182 | 1182 |
|
1183 | 1183 | /* This is a weird hack for me not yet following the commonmark spec
|
|
1424 | 1424 | <div class="head">
|
1425 | 1425 | <p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
|
1426 | 1426 | <h1 class="p-name no-ref" id="title">Service Workers Nightly</h1>
|
1427 |
| - <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2016-11-11">11 November 2016</time></span></h2> |
| 1427 | + <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2016-11-17">17 November 2016</time></span></h2> |
1428 | 1428 | <div data-fill-with="spec-metadata">
|
1429 | 1429 | <dl>
|
1430 | 1430 | <dt>This version:
|
@@ -4525,7 +4525,12 @@ <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export="" id="o
|
4525 | 4525 | </ol>
|
4526 | 4526 | <li>Let <var>activeWorker</var> be <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker-29">active worker</a>.
|
4527 | 4527 | <li>
|
4528 |
| - If <var>activeWorker</var>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle-2">set of event types to handle</a> does not contain <code>fetch</code>, return null. |
| 4528 | + If <var>activeWorker</var>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle-2">set of event types to handle</a> does not contain <code>fetch</code>, then: |
| 4529 | + <ol> |
| 4530 | + <li>Return null and continue running these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
| 4531 | + <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-4">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
| 4532 | + <li>Abort these steps. |
| 4533 | + </ol> |
4529 | 4534 | <p class="note" role="note">To avoid unnecessary delays, the Handle Fetch enforces early return when no event listeners have been deterministically added in the service worker’s global during the very first script execution.</p>
|
4530 | 4535 | <li>If <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state-10">state</a> is <em>activating</em>, wait for <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state-11">state</a> to become <em>activated</em>.
|
4531 | 4536 | <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>activeWorker</var> as the argument.
|
@@ -4555,22 +4560,22 @@ <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export="" id="o
|
4555 | 4560 | <li>
|
4556 | 4561 | If <var>respondWithEntered</var> is false, then:
|
4557 | 4562 | <ol>
|
4558 |
| - <li>If <var>eventCanceled</var> is true, return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error">network error</a> and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
4559 |
| - <li>Else, return null and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
4560 |
| - <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-4">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
| 4563 | + <li>If <var>eventCanceled</var> is true, return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error">network error</a> and continue running these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
| 4564 | + <li>Else, return null and continue running these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
| 4565 | + <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-5">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
4561 | 4566 | <li>Abort these steps.
|
4562 | 4567 | </ol>
|
4563 | 4568 | <li>
|
4564 | 4569 | If <var>handleFetchFailed</var> is true, then:
|
4565 | 4570 | <ol>
|
4566 |
| - <li>Return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error">network error</a> and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
4567 |
| - <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-5">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
| 4571 | + <li>Return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error">network error</a> and continue running these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
| 4572 | + <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-6">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
4568 | 4573 | </ol>
|
4569 | 4574 | <li>
|
4570 | 4575 | Else:
|
4571 | 4576 | <ol>
|
4572 |
| - <li>Return <var>response</var> and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
4573 |
| - <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-6">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
| 4577 | + <li>Return <var>response</var> and continue running these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
| 4578 | + <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-7">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
4574 | 4579 | </ol>
|
4575 | 4580 | </ol>
|
4576 | 4581 | </section>
|
@@ -4684,15 +4689,20 @@ <h3 class="heading settled" id="handle-functional-event-algorithm"><span class="
|
4684 | 4689 | <li><a data-link-type="dfn" href="http://tc39.github.io/ecma262/#sec-algorithm-conventions">Assert</a>: <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker-30">active worker</a> is not null.
|
4685 | 4690 | <li>Let <var>activeWorker</var> be <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker-31">active worker</a>.
|
4686 | 4691 | <li>
|
4687 |
| - If <var>activeWorker</var>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle-3">set of event types to handle</a> does not contain the event type for this functional event, return. |
| 4692 | + If <var>activeWorker</var>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle-3">set of event types to handle</a> does not contain the event type for this functional event, then: |
| 4693 | + <ol> |
| 4694 | + <li>Return and continue running these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>. |
| 4695 | + <li>If the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-8">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
| 4696 | + <li>Abort these steps. |
| 4697 | + </ol> |
4688 | 4698 | <p class="note" role="note">To avoid unnecessary delays, the Handle Functional Event enforces early return when no event listeners have been deterministically added in the service worker’s global during the very first script execution.</p>
|
4689 | 4699 | <li>If <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state-14">state</a> is <em>activating</em>, wait for <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state-15">state</a> to become <em>activated</em>.
|
4690 | 4700 | <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>activeWorker</var> as the argument.
|
4691 | 4701 | <li>
|
4692 | 4702 | <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">Queue a task</a> <var>task</var> to invoke <var>callbackSteps</var> with <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global">global object</a> as its argument.
|
4693 | 4703 | <p>The <var>task</var> <em class="rfc2119" title="MUST">must</em> use <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">event loop</a> and the <a href="#dfn-handle-functional-event-task-source" id="ref-for-dfn-handle-functional-event-task-source-4">handle functional event task source</a>.</p>
|
4694 | 4704 | <li>Wait for <var>task</var> to have executed or been discarded.
|
4695 |
| - <li>If the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-7">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
| 4705 | + <li>If the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time-9">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>. |
4696 | 4706 | </ol>
|
4697 | 4707 | </section>
|
4698 | 4708 | <section class="algorithm" data-algorithm="on-client-unload-algorithm">
|
@@ -6615,8 +6625,8 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
|
6615 | 6625 | <b><a href="#dfn-last-update-check-time">#dfn-last-update-check-time</a></b><b>Referenced in:</b>
|
6616 | 6626 | <ul>
|
6617 | 6627 | <li><a href="#ref-for-dfn-last-update-check-time-1">Update</a> <a href="#ref-for-dfn-last-update-check-time-2">(2)</a> <a href="#ref-for-dfn-last-update-check-time-3">(3)</a>
|
6618 |
| - <li><a href="#ref-for-dfn-last-update-check-time-4">Handle Fetch</a> <a href="#ref-for-dfn-last-update-check-time-5">(2)</a> <a href="#ref-for-dfn-last-update-check-time-6">(3)</a> |
6619 |
| - <li><a href="#ref-for-dfn-last-update-check-time-7">Handle Functional Event</a> |
| 6628 | + <li><a href="#ref-for-dfn-last-update-check-time-4">Handle Fetch</a> <a href="#ref-for-dfn-last-update-check-time-5">(2)</a> <a href="#ref-for-dfn-last-update-check-time-6">(3)</a> <a href="#ref-for-dfn-last-update-check-time-7">(4)</a> |
| 6629 | + <li><a href="#ref-for-dfn-last-update-check-time-8">Handle Functional Event</a> <a href="#ref-for-dfn-last-update-check-time-9">(2)</a> |
6620 | 6630 | </ul>
|
6621 | 6631 | </aside>
|
6622 | 6632 | <aside class="dfn-panel" data-for="dfn-uninstalling-flag">
|
|
0 commit comments