Skip to content

Commit c42619e

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 55c501f commit c42619e

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
@@ -550,6 +550,33 @@ <h2>
550550
When called, this method executes the following steps:
551551
</p>
552552
<ol>
553+
<li>Let <var>registration</var> be the <a>PaymentInstrument</a>'s
554+
associated <a>service worker registration</a>.
555+
</li>
556+
<li>If <var>registration</var> has no <a>active worker</a>, run the
557+
following substeps:
558+
<ol>
559+
<li>If <var>registration</var> has no <a>installing worker</a>
560+
and no <a>waiting worker</a>, then reject a <a>Promise</a> with
561+
a <a>DOMException</a> whose name is
562+
"<code><a>InvalidStateError</a></code>" and terminate these
563+
steps.
564+
</li>
565+
<li>Wait for the <a>installing worker</a> or <a>waiting
566+
worker</a> of <var>registration</var> to become its <a>active
567+
worker</a>.
568+
</li>
569+
<li>If <var>registration</var> fails to activate either worker,
570+
reject <var>promise</var> with a
571+
<code><a>DOMException</a></code> whose name is
572+
"<code><a>InvalidStateError</a></code>" and terminate these
573+
steps.
574+
</li>
575+
<li>Once <var>registration</var> has an <a>active worker</a>,
576+
proceed with the steps below.
577+
</li>
578+
</ol>
579+
</li>
553580
<li>Let <var>permission</var> be the result of running
554581
<a data-cite="!permissions#dfn-retrieve-the-permission-state">retrieving
555582
the permission state</a> of the permission associated with
@@ -2151,8 +2178,10 @@ <h2>
21512178
<dd>
21522179
The terms <dfn data-cite=
21532180
"!SERVICE-WORKERS#service-worker-concept">service worker</dfn>,
2154-
<dfn data-cite="!SERVICE-WORKERS#dfn-service-worker-client">service
2155-
worker client</dfn>, <code><dfn data-cite=
2181+
<dfn>service worker registration</dfn>, <dfn>active worker</dfn>,
2182+
<dfn>installing worker</dfn>, <dfn data-cite=
2183+
"!SERVICE-WORKERS#dfn-service-worker-client">service worker
2184+
client</dfn>, <code><dfn data-cite=
21562185
"!SERVICE-WORKERS#service-worker-registration-concept">ServiceWorkerRegistration</dfn></code>,
21572186
<code><dfn data-cite=
21582187
"!SERVICE-WORKERS#service-worker-global-scope">ServiceWorkerGlobalScope</dfn></code>,

0 commit comments

Comments
 (0)