Skip to content

Commit 844f770

Browse files
committed
Only allows instrument.set() in active service worker
Like other service worker family features, we should only allow instrument.set() in active service worker. This fixes w3c#223 issue.
1 parent 06f0913 commit 844f770

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

index.html

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,33 @@ <h2>
494494
When called, this method executes the following steps:
495495
</p>
496496
<ol>
497+
<li>Let <var>registration</var> be the <a>PaymentInstrument</a>'s
498+
associated <a>service worker registration</a>.
499+
</li>
500+
<li>If <var>registration</var> has no <a>active worker</a>, run the
501+
following substeps:
502+
<ol>
503+
<li>If <var>registration</var> has no <a>installing worker</a>
504+
and no <a>waiting worker</a>, then reject a <a>Promise</a> with
505+
a <a>DOMException</a> whose name is
506+
"<code><a>InvalidStateError</a></code>" and terminate these
507+
steps.
508+
</li>
509+
<li>Wait for the <a>installing worker</a> or <a>waiting
510+
worker</a> of <var>registration</var> to become its <a>active
511+
worker</a>.
512+
</li>
513+
<li>If <var>registration</var> fails to activate either worker,
514+
reject <var>promise</var> with a
515+
<code><a>DOMException</a></code> whose name is
516+
"<code><a>InvalidStateError</a></code>" and terminate these
517+
steps.
518+
</li>
519+
<li>Once <var>registration</var> has an <a>active worker</a>,
520+
proceed with the steps below.
521+
</li>
522+
</ol>
523+
</li>
497524
<li>Let <var>permission</var> be the result of running
498525
<a data-cite="!permissions#dfn-retrieve-the-permission-state">retrieving
499526
the permission state</a> of the permission associated with
@@ -1993,8 +2020,10 @@ <h2>
19932020
<dd>
19942021
The terms <dfn data-cite=
19952022
"!SERVICE-WORKERS#service-worker-concept">service worker</dfn>,
1996-
<dfn data-cite="!SERVICE-WORKERS#dfn-service-worker-client">service
1997-
worker client</dfn>, <code><dfn data-cite=
2023+
<dfn>service worker registration</dfn>, <dfn>active worker</dfn>,
2024+
<dfn>installing worker</dfn>, <dfn data-cite=
2025+
"!SERVICE-WORKERS#dfn-service-worker-client">service worker
2026+
client</dfn>, <code><dfn data-cite=
19982027
"!SERVICE-WORKERS#service-worker-registration-concept">ServiceWorkerRegistration</dfn></code>,
19992028
<code><dfn data-cite=
20002029
"!SERVICE-WORKERS#service-worker-global-scope">ServiceWorkerGlobalScope</dfn></code>,

0 commit comments

Comments
 (0)