Skip to content

Commit c4c1250

Browse files
committed
Define service worker client's origin algorithm
This defines the concept's origin algorithm that returns a relevant value for both enviroments and environment settings objects. This also incorporates the changes of the corresponding links to this definition, and leaves an issue note about the WIP execution ready flag PR.
1 parent c296225 commit c4c1250

File tree

4 files changed

+164
-146
lines changed

4 files changed

+164
-146
lines changed

docs/index.bs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
287287

288288
<p>A <a href="#dfn-service-worker-client">service worker client</a> has an associated <dfn id="dfn-service-worker-client-frame-type">frame type</dfn>, which is one of <em>auxiliary</em>, <em>top-level</em>, <em>nested</em>, and <em>none</em>. Unless stated otherwise it is <em>none</em>.
289289

290+
<p>A <a for="/">service worker client</a> has an algorithm defined as the <dfn for="service worker client">origin</dfn> that returns the <a for="/">service worker client</a>'s <a>creation URL</a>'s <a for="url">origin</a> if the <a for="/">service worker client</a> is a type of <a>environment</a>, and the <a for="/">service worker client</a>'s <a for="environment settings object">origin</a> otherwise.</p>
291+
290292
<p>A <dfn id="dfn-window-client">window client</dfn> is a <a href="#dfn-service-worker-client">service worker client</a> whose <a for="environment settings object">global object</a> is a {{Window}} object.</p>
291293

292294
<p>A <dfn id="dfn-dedicatedworker-client">dedicated worker client</dfn> is a <a href="#dfn-service-worker-client">service worker client</a> whose <a for="environment settings object">global object</a> is a {{DedicatedWorkerGlobalScope}} object.</p>
@@ -1121,6 +1123,8 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
11211123
<h4 id="client-reserved">{{Client/reserved}}</h4>
11221124

11231125
<p>The <dfn attribute for="Client" id="client-reserved-attribute"><code>reserved</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return true if the <a>context object</a>'s associated <a for="Client">service worker client</a>'s <a for="environment">execution ready flag</a> is unset, and false otherwise.</p>
1126+
1127+
<p class="issue">Defining the execution ready flag is a work in progress. See <a href="https://github.com/whatwg/html/pull/2004">the pull request to HTML</a>.</p>
11241128
</section>
11251129

11261130
<section algorithm="client-postmessage">
@@ -1274,8 +1278,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
12741278
<li>Let <var>promise</var> be a new <a>promise</a>.</li>
12751279
<li>Run these substeps <a>in parallel</a>:
12761280
<ol>
1277-
<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>:
1278-
<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>
1281+
<li>For each <a href="#dfn-service-worker-client">service worker client</a> <var>client</var> whose <a for="service worker client">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>:
12791282
<ol>
12801283
<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>
12811284
<li>If <var>client</var> is a type of <a>environment</a>, then:
@@ -1331,8 +1334,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
13311334
<li>Run these substeps <a>in parallel</a>:
13321335
<ol>
13331336
<li>Let <var>targetClients</var> be an empty array.</li>
1334-
<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>:
1335-
<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>
1337+
<li>For each <a href="#dfn-service-worker-client">service worker client</a> <var>client</var> whose <a for="service worker client">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>:
13361338
<ol>
13371339
<li>If <var>client</var> is a type of <a>environment</a>, then:
13381340
<ol>
@@ -1453,8 +1455,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
14531455
<li>Let <var>promise</var> be a new <a>promise</a>.</li>
14541456
<li>Run the following substeps <a>in parallel</a>:
14551457
<ol>
1456-
<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 <a href="#dfn-service-worker-global-scope-service-worker">service worker</a>'s <a for="resource">origin</a>:
1457-
<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>
1458+
<li>For each <a href="#dfn-service-worker-client">service worker client</a> <var>client</var> whose <a for="service worker client">origin</a> is the <a lt="same origin">same</a> as the <a href="#dfn-service-worker-global-scope-service-worker">service worker</a>'s <a for="resource">origin</a>:
14581459
<ol>
14591460
<li>If <var>client</var> is a type of <a>environment</a>, then:
14601461
<ol>

0 commit comments

Comments
 (0)