Skip to content

Commit be8f713

Browse files
committed
Updating prose based on w3c/ServiceWorker#1199
1 parent fc62065 commit be8f713

File tree

2 files changed

+16
-36
lines changed

2 files changed

+16
-36
lines changed

index.bs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -329,19 +329,13 @@ The <dfn attribute for="ServiceWorkerRegistration">backgroundFetch</dfn> attribu
329329
1. If |activeBgFetches| does not [=active background fetches/contain=] |bgFetch|, then [=resolve=] |promise| with false and abort these steps.
330330
1. Remove |activeBgFetches|[|id|].
331331
1. [=Resolve=] |promise| with true.
332-
1. TODO: terminate the fetches
333-
1. Let |eventType| be `"backgroundfetchabort"`.
334-
1. [=Handle functional event=] for |swRegistration| and |eventType| using the following steps:
332+
1. TODO: terminate the fetches.
333+
1. [=Fire a functional event=] named "`backgroundfetchabort`" using {{BackgroundFetchSettledEvent}} on |swRegistration| with the following properties:
335334

336-
Issue: This isn't quite how [=handle functional event=] works, but its current definition doesn't really make sense ([issue](https://github.com/w3c/ServiceWorker/issues/1196)).
335+
: {{BackgroundFetchSettledEvent/fetches}}
336+
:: A new {{BackgroundFetchSettledFetches}}. TODO: associate this with |bgFetch|'s [=background fetch/records=].
337337

338-
1. Let |event| be the result of [=creating an event=] with {{BackgroundFetchSettledEvent}}.
339-
1. Let |settledFetches| be a new {{BackgroundFetchSettledFetches}}. TODO: associate this with |bgFetch|'s [=background fetch/records=].
340-
1. Initialise |event|'s {{Event/type}} to |eventType|.
341-
1. Initialise |event|'s {{BackgroundFetchSettledEvent/fetches}} to |settledFetches|.
342-
1. Dispatch a service worker event |event|.
343-
344-
Issue: Also part of the previous [issue](https://github.com/w3c/ServiceWorker/issues/1196).
338+
Issue: The above prose is based on [ServiceWorker/#1199](https://github.com/w3c/ServiceWorker/pull/1199).
345339
</div>
346340
</div>
347341

index.html

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@
11781178
</style>
11791179
<meta content="Bikeshed version 459c2a65222f1973d4f1846a767ec88e8a5dae3e" name="generator">
11801180
<link href="https://jakearchibald.github.io/background-fetch" rel="canonical">
1181-
<meta content="a3bb2d0f0739c391f7fc951b36b1e58927a00634" name="document-revision">
1181+
<meta content="fc6206509a5fa3c5e9071356bb0c42d3c2450b4d" name="document-revision">
11821182
<style>/* style-md-lists */
11831183

11841184
/* This is a weird hack for me not yet following the commonmark spec
@@ -1425,7 +1425,7 @@
14251425
<div class="head">
14261426
<p data-fill-with="logo"></p>
14271427
<h1 class="p-name no-ref" id="title">Background Fetch</h1>
1428-
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2017-09-21">21 September 2017</time></span></h2>
1428+
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2017-09-25">25 September 2017</time></span></h2>
14291429
<div data-fill-with="spec-metadata">
14301430
<dl>
14311431
<dt>This version:
@@ -1927,25 +1927,15 @@ <h4 class="heading settled" data-level="4.3.1" id="background-fetch-registration
19271927
<li data-md="">
19281928
<p><a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#resolve-promise" id="ref-for-resolve-promise⑥">Resolve</a> <var>promise</var> with true.</p>
19291929
<li data-md="">
1930-
<p>TODO: terminate the fetches</p>
1930+
<p>TODO: terminate the fetches.</p>
19311931
<li data-md="">
1932-
<p>Let <var>eventType</var> be <code>"backgroundfetchabort"</code>.</p>
1933-
<li data-md="">
1934-
<p><a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#handle-functional-event" id="ref-for-handle-functional-event">Handle functional event</a> for <var>swRegistration</var> and <var>eventType</var> using the following steps:</p>
1935-
<p class="issue" id="issue-ea032efd"><a class="self-link" href="#issue-ea032efd"></a> This isn’t quite how <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#handle-functional-event" id="ref-for-handle-functional-event①">handle functional event</a> works, but its current definition doesn’t really make sense (<a href="https://github.com/w3c/ServiceWorker/issues/1196">issue</a>).</p>
1936-
<ol>
1937-
<li data-md="">
1938-
<p>Let <var>event</var> be the result of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-create" id="ref-for-concept-event-create">creating an event</a> with <code class="idl"><a data-link-type="idl" href="#backgroundfetchsettledevent" id="ref-for-backgroundfetchsettledevent">BackgroundFetchSettledEvent</a></code>.</p>
1939-
<li data-md="">
1940-
<p>Let <var>settledFetches</var> be a new <code class="idl"><a data-link-type="idl" href="#backgroundfetchsettledfetches" id="ref-for-backgroundfetchsettledfetches">BackgroundFetchSettledFetches</a></code>. TODO: associate this with <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records③">records</a>.</p>
1941-
<li data-md="">
1942-
<p>Initialise <var>event</var>’s <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-type" id="ref-for-dom-event-type">type</a></code> to <var>eventType</var>.</p>
1943-
<li data-md="">
1944-
<p>Initialise <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchsettledevent-fetches" id="ref-for-dom-backgroundfetchsettledevent-fetches">fetches</a></code> to <var>settledFetches</var>.</p>
1945-
<li data-md="">
1946-
<p>Dispatch a service worker event <var>event</var>.</p>
1947-
<p class="issue" id="issue-f46bb3b7"><a class="self-link" href="#issue-f46bb3b7"></a> Also part of the previous <a href="https://github.com/w3c/ServiceWorker/issues/1196">issue</a>.</p>
1948-
</ol>
1932+
<p><a data-link-type="dfn">Fire a functional event</a> named "<code>backgroundfetchabort</code>" using <code class="idl"><a data-link-type="idl" href="#backgroundfetchsettledevent" id="ref-for-backgroundfetchsettledevent">BackgroundFetchSettledEvent</a></code> on <var>swRegistration</var> with the following properties:</p>
1933+
<dl>
1934+
<dt data-md=""><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchsettledevent-fetches" id="ref-for-dom-backgroundfetchsettledevent-fetches">fetches</a></code>
1935+
<dd data-md="">
1936+
<p>A new <code class="idl"><a data-link-type="idl" href="#backgroundfetchsettledfetches" id="ref-for-backgroundfetchsettledfetches">BackgroundFetchSettledFetches</a></code>. TODO: associate this with <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records③">records</a>.</p>
1937+
</dl>
1938+
<p class="issue" id="issue-75d0102a"><a class="self-link" href="#issue-75d0102a"></a> The above prose is based on <a href="https://github.com/w3c/ServiceWorker/pull/1199">ServiceWorker/#1199</a>.</p>
19491939
</ol>
19501940
</ol>
19511941
</div>
@@ -2370,8 +2360,6 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
23702360
<ul>
23712361
<li><a href="https://dom.spec.whatwg.org/#eventtarget">EventTarget</a>
23722362
<li><a href="https://dom.spec.whatwg.org/#context-object">context object</a>
2373-
<li><a href="https://dom.spec.whatwg.org/#concept-event-create">creating an event</a>
2374-
<li><a href="https://dom.spec.whatwg.org/#dom-event-type">type</a>
23752363
</ul>
23762364
<li>
23772365
<a data-link-type="biblio">[FETCH]</a> defines the following terms:
@@ -2447,7 +2435,6 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
24472435
<li><a href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope">ServiceWorkerGlobalScope</a>
24482436
<li><a href="https://w3c.github.io/ServiceWorker/#serviceworkerregistration">ServiceWorkerRegistration</a>
24492437
<li><a href="https://w3c.github.io/ServiceWorker/#dfn-active-worker">active worker</a>
2450-
<li><a href="https://w3c.github.io/ServiceWorker/#handle-functional-event">handle functional event</a>
24512438
<li><a href="https://w3c.github.io/ServiceWorker/#dfn-service-worker">service worker</a>
24522439
<li><a href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration">service worker registration</a>
24532440
<li><a href="https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil">waitUntil(f)</a>
@@ -2600,8 +2587,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
26002587
<div class="issue"> Fetch waits for the whole body before returning <var>response</var>. Let’s pretend it <em>doesn’t</em> do that <a href="https://github.com/whatwg/fetch/issues/536#issuecomment-330184276">issue</a>.<a href="#issue-ba3b5fd8"></a></div>
26012588
<div class="issue"> Fetch doesn’t currently expose this <a href="https://github.com/whatwg/fetch/issues/605">(issue)</a>.<a href="#issue-8840f7f0"></a></div>
26022589
<div class="issue"> This isn’t correctly set in fetch (<a href="https://github.com/whatwg/fetch/issues/604">issue</a>).<a href="#issue-9b0afb74"></a></div>
2603-
<div class="issue"> This isn’t quite how <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#handle-functional-event">handle functional event</a> works, but its current definition doesn’t really make sense (<a href="https://github.com/w3c/ServiceWorker/issues/1196">issue</a>).<a href="#issue-ea032efd"></a></div>
2604-
<div class="issue"> Also part of the previous <a href="https://github.com/w3c/ServiceWorker/issues/1196">issue</a>.<a href="#issue-f46bb3b7"></a></div>
2590+
<div class="issue"> The above prose is based on <a href="https://github.com/w3c/ServiceWorker/pull/1199">ServiceWorker/#1199</a>.<a href="#issue-75d0102a"></a></div>
26052591
</div>
26062592
<aside class="dfn-panel" data-for="service-worker-registration-active-background-fetches">
26072593
<b><a href="#service-worker-registration-active-background-fetches">#service-worker-registration-active-background-fetches</a></b><b>Referenced in:</b>

0 commit comments

Comments
 (0)