You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit embraces the recently added environment concept in
enumerating service worker clients. Also, for an environment type
client, it references the environment's target browsing context's
active document's UI properties to set the visibilityState and the
focused state.
Related commit: 8b483b0
<li>For each <a href="#dfn-service-worker-client">service worker client</a><var>client</var> whose <a for="resource">origin</a> is the <a lt="same origin">same</a> as the associated <a href="#dfn-service-worker-global-scope-service-worker">service worker</a>'s <a for="resource">origin</a>:
1275
+
<p class="issue">For environment type clients, the environment's creation URL's origin should be used for the origin check instead of the client's origin. See <a href="https://github.com/whatwg/html/issues/1992">the issue</a> to define the environment's origin algorithm.</p>
1275
1276
<ol>
1276
-
<li>If <var>client</var>'s <a for="environment">id</a> is <var>id</var>, then:
1277
+
<li>If <var>client</var>'s <a for="environment">id</a> is not <var>id</var>, continue to the next iteration of the loop.</li>
1278
+
<li>If <var>client</var> is a type of <a>environment</a>, then:
1279
+
<ol>
1280
+
<li>If <var>client</var>’s <a>creation URL</a> is not a <a>potentially trustworthy URL</a>, reject <var>promise</var> with a "{{SecurityError}}" exception and abort these steps.</li>
1281
+
</ol>
1282
+
</li>
1283
+
<li>Else:
1277
1284
<ol>
1278
1285
<li>If <var>client</var> is not a <a>secure context</a>, reject <var>promise</var> with a "{{SecurityError}}" exception and abort these steps.</li>
1279
-
<li>If <var>client</var> is a <a href="#dfn-window-client">window client</a>, then:
<li><a>Queue a task</a><var>task</var> to run the following substeps:
1285
-
<ol>
1286
-
<li>Set <var>visibilityState</var> to <var>browsingContext</var>'s <a>active document</a>'s {{Document/visibilityState}} attribute value.</li>
1287
-
<li>Set <var>focusState</var> to the result of running the <a>has focus steps</a> with <var>browsingContext</var>'s <a>active document</a> as the argument.</li>
1288
-
</ol>
1289
-
</li>
1290
-
<li>Wait for <var>task</var> to have executed.</li>
1291
-
<li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.</li>
1292
-
<li>Resolve <var>promise</var> with <var>windowClient</var> and abort these steps.</li>
1293
-
</ol>
1294
-
</li>
1295
-
<li>Else:
1286
+
</ol>
1287
+
</li>
1288
+
<li>If <var>client</var> is a type of <a>environment</a> or is a <a href="#dfn-window-client">window client</a>, then:
1289
+
<ol>
1290
+
<li>Let <var>browsingContext</var> be null.</li>
1291
+
<li>Let <var>visibilityState</var> be null.</li>
1292
+
<li>Let <var>focusState</var> be null.</li>
1293
+
<li>If <var>client</var> is a type of <a>environment</a>, set <var>browsingContext</var> to <var>client</var>’s <a for="environment">target browsing context</a>.</li>
1294
+
<li>Else, set <var>browsingContext</var> to <var>client</var>'s <a for="environment settings object">global object</a>'s <a for="/">browsing context</a>.</li>
1295
+
<li><a>Queue a task</a><var>task</var> to run the following substeps:
1296
1296
<ol>
1297
-
<li>Let<var>clientObject</var>be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.</li>
1298
-
<li>Resolve<var>promise</var> with <var>clientObject</var> and abort these steps.</li>
<li>Set<var>focusState</var>to the result of running the <a>has focus steps</a>with <var>browsingContext</var>'s <a>active document</a> as the argument.</li>
1299
1299
</ol>
1300
1300
</li>
1301
+
<li>Wait for <var>task</var> to have executed.</li>
1302
+
<li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.</li>
1303
+
<li>Resolve <var>promise</var> with <var>windowClient</var> and abort these steps.</li>
1304
+
</ol>
1305
+
</li>
1306
+
<li>Else:
1307
+
<ol>
1308
+
<li>Let <var>clientObject</var> be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.</li>
1309
+
<li>Resolve <var>promise</var> with <var>clientObject</var> and abort these steps.</li>
For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client-24">service worker client</a> <var>client</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#same-origin">same</a> as the associated <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker-7">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">origin</a>:
2567
+
<p class="issue" id="issue-eb16f4c7"><a class="self-link" href="#issue-eb16f4c7"></a>For environment type clients, the environment’s creation URL’s origin should be used for the origin check instead of the client’s origin. See <a href="https://github.com/whatwg/html/issues/1992">the issue</a> to define the environment’s origin algorithm.</p>
2567
2568
<ol>
2569
+
<li>If <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-id">id</a> is not <var>id</var>, continue to the next iteration of the loop.
2568
2570
<li>
2569
-
If <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-id">id</a> is <var>id</var>, then:
2571
+
If <var>client</var> is a type of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment">environment</a>, then:
2572
+
<ol>
2573
+
<li>If <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url">creation URL</a> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url">potentially trustworthy URL</a>, reject <var>promise</var> with a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror">SecurityError</a></code>" exception and abort these steps.
2574
+
</ol>
2575
+
<li>
2576
+
Else:
2570
2577
<ol>
2571
2578
<li>If <var>client</var> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#secure-context">secure context</a>, reject <var>promise</var> with a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror">SecurityError</a></code>" exception and abort these steps.
2579
+
</ol>
2580
+
<li>
2581
+
If <var>client</var> is a type of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment">environment</a> or is a <a href="#dfn-window-client" id="ref-for-dfn-window-client-4">window client</a>, then:
2582
+
<ol>
2583
+
<li>Let <var>browsingContext</var> be null.
2584
+
<li>Let <var>visibilityState</var> be null.
2585
+
<li>Let <var>focusState</var> be null.
2586
+
<li>If <var>client</var> is a type of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment">environment</a>, set <var>browsingContext</var> to <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-target-browsing-context">target browsing context</a>.
2587
+
<li>Else, set <var>browsingContext</var> to <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a>.
2572
2588
<li>
2573
-
If <var>client</var> is a <a href="#dfn-window-client" id="ref-for-dfn-window-client-4">window client</a>, then:
<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 run the following substeps:
<li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a> as the argument.
2583
-
</ol>
2584
-
<li>Wait for <var>task</var> to have executed.
2585
-
<li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
2586
-
<li>Resolve <var>promise</var> with <var>windowClient</var> and abort these steps.
2587
-
</ol>
2588
-
<li>
2589
-
Else:
2589
+
<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 run the following substeps:
2590
2590
<ol>
2591
-
<li>Let <var>clientObject</var> be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.
2592
-
<li>Resolve <var>promise</var> with <var>clientObject</var> and abort these steps.
<li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a> as the argument.
2593
2593
</ol>
2594
+
<li>Wait for <var>task</var> to have executed.
2595
+
<li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
2596
+
<li>Resolve <var>promise</var> with <var>windowClient</var> and abort these steps.
2597
+
</ol>
2598
+
<li>
2599
+
Else:
2600
+
<ol>
2601
+
<li>Let <var>clientObject</var> be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.
2602
+
<li>Resolve <var>promise</var> with <var>clientObject</var> and abort these steps.
<div class="issue">For environment type clients, the environment’s creation URL’s origin should be used for the origin check instead of the client’s origin. See <a href="https://github.com/whatwg/html/issues/1992">the issue</a> to define the environment’s origin algorithm.<a href="#issue-eb16f4c7"> ↵ </a></div>
6399
6410
<div class="issue">The response’s cache state concept had been removed from fetch. The fetch issue <a href="https://github.com/whatwg/fetch/issues/376">#376</a> tracks the request to restore the concept or add some similar way to check this state.<a href="#issue-3c7457a0"> ↵ </a></div>
0 commit comments