Skip to content

Commit

Permalink
Define service worker client's origin algorithm
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jungkees committed Nov 4, 2016
1 parent c296225 commit c4c1250
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 146 deletions.
13 changes: 7 additions & 6 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231

<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>.

<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>

<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>

<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>
Expand Down Expand Up @@ -1121,6 +1123,8 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
<h4 id="client-reserved">{{Client/reserved}}</h4>

<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>

<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>
</section>

<section algorithm="client-postmessage">
Expand Down Expand Up @@ -1274,8 +1278,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
<li>Let <var>promise</var> be a new <a>promise</a>.</li>
<li>Run these substeps <a>in parallel</a>:
<ol>
<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>:
<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>
<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>:
<ol>
<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>
<li>If <var>client</var> is a type of <a>environment</a>, then:
Expand Down Expand Up @@ -1331,8 +1334,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
<li>Run these substeps <a>in parallel</a>:
<ol>
<li>Let <var>targetClients</var> be an empty array.</li>
<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>:
<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>
<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>:
<ol>
<li>If <var>client</var> is a type of <a>environment</a>, then:
<ol>
Expand Down Expand Up @@ -1453,8 +1455,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
<li>Let <var>promise</var> be a new <a>promise</a>.</li>
<li>Run the following substeps <a>in parallel</a>:
<ol>
<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>:
<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>
<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>:
<ol>
<li>If <var>client</var> is a type of <a>environment</a>, then:
<ol>
Expand Down
Loading

0 comments on commit c4c1250

Please sign in to comment.