Skip to content

Commit

Permalink
Add request's reserved client and target client id
Browse files Browse the repository at this point in the history
This patch defines the request's reserved client and the target client
id. The reserved client of a request is set to an environment or an
environment settings object during a navigation or a worker creation
request, respectively. The target client id of a request is set to the
target browsing context's active document's environment settings
object's id during a navigation. The given values are primarily used
to provide the reserved client's id and target client's id to service
workers' fetch event handlers.

This removes the request's target browsing context as the reserved
client provides the same information.

Related issue: w3c/ServiceWorker#870
Related change: whatwg/html#1776
  • Loading branch information
jungkees authored and dontcallmedom committed Oct 24, 2016
1 parent 61fd8a3 commit c949f0d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
26 changes: 21 additions & 5 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="https://whatwg.org/"><img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-fetch.svg" width="100"></a>
<h1 id="cors">Fetch</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-17-october-2016">Living Standard — Last Updated 17 October 2016</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-24-october-2016">Living Standard — Last Updated 24 October 2016</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -731,6 +731,26 @@ <h4 id="requests"><span class="secno">3.1.5 </span>Requests</h4>
<dfn data-dfn-for="request" data-export="" id="concept-request-client" title="concept-request-client">client</dfn> (null or an
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a>).

<p>A <a href="#concept-request" title="concept-request">request</a> has an associated
<dfn data-dfn-for="request" data-export="" id="concept-request-reserved-client" title="concept-request-reserved-client">reserved client</dfn>
(null, an <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment">environment</a>, or an
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a>). Unless stated otherwise it is null.

<p class="note no-backref">This is only used by <span>navigation requests</span> and worker
requests, but not service worker requests. It references an
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment">environment</a> for a <a href="#navigation-request">navigation request</a> and an
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a> for a worker request.

<p>A <a href="#concept-request" title="concept-request">request</a> has an associated
<dfn data-dfn-for="request" data-export="" id="concept-request-target-client-id" title="concept-request-target-client-id">target client id</dfn>
(a string). Unless stated otherwise it is the empty string.

<p class="note no-backref">This is only used by <span>navigation requests</span>. It is the
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-id" title="concept-environment-id">id</a> of the
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-target-browsing-context">target browsing context</a>'s
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>'s
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a>.

<p>A <a href="#concept-request" title="concept-request">request</a> has an associated
<dfn data-dfn-for="request" data-export="" id="concept-request-window" title="concept-request-window">window</dfn>
("<code>no-window</code>", "<code>client</code>", or an
Expand All @@ -745,10 +765,6 @@ <h4 id="requests"><span class="secno">3.1.5 </span>Requests</h4>
explicitly set <a href="#concept-request" title="concept-request">request</a>'s
<a href="#concept-request-window" title="concept-request-window">window</a>.

<p>A <a href="#concept-request" title="concept-request">request</a> has an associated
<dfn data-dfn-for="request" data-export="" id="concept-request-target-browsing-context" title="concept-request-target-browsing-context">target browsing context</dfn>
(null or a <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a>). Unless stated otherwise it is null.

<p id="keep-alive-flag">A <a href="#concept-request" title="concept-request">request</a> has an associated
<dfn id="keepalive-flag">keepalive flag</dfn>. Unless stated otherwise it is unset.

Expand Down
27 changes: 23 additions & 4 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ urlPrefix: https://html.spec.whatwg.org/multipage/
text: ancestor browsing context
text:origin
for:browser
urlPrefix: webappis.html
text:environment
text:environment id
url:https://html.spec.whatwg.org/multipage/webappapis.html#https-state;spec:html;text:HTTPS state;type:dfn
url:https://w3c.github.io/webappsec-referrer-policy/#enumdef-referrerpolicy
type:interface
Expand Down Expand Up @@ -746,6 +749,26 @@ outlawing <a>forbidden methods</a> and
<dfn data-export for=request id=concept-request-client>client</dfn> (null or an
<a spec=html>environment settings object</a>).

<p>A <a for="/">request</a> has an associated
<dfn id=concept-request-reserved-client data-export for=request>reserved client</dfn>
(null, an <a spec=html>environment</a>, or an
<a spec=html>environment settings object</a>). Unless stated otherwise it is null.

<p class="note no-backref">This is only used by <a>navigation requests</a> and worker
requests, but not service worker requests. It references an
<a spec=html>environment</a> for a <a>navigation request</a> and an
<a spec=html>environment settings object</a> for a worker request.

<p>A <a for="/">request</a> has an associated
<dfn id=concept-request-target-client-id data-export for=request>target client id</dfn>
(a string). Unless stated otherwise it is the empty string.

<p class="note no-backref">This is only used by <a>navigation requests</a>. It is the
<a lt="environment id" spec=html>id</a> of the
<a spec=html>target browsing context</a>'s
<a spec=html>active document</a>'s
<a spec=html>environment settings object</a>.

<p>A <a for="/">request</a> has an associated
<dfn data-export for=request id=concept-request-window>window</dfn>
("<code>no-window</code>", "<code>client</code>", or an
Expand All @@ -760,10 +783,6 @@ outlawing <a>forbidden methods</a> and
explicitly set <a for="/">request</a>'s
<a for=request>window</a>.

<p>A <a for="/">request</a> has an associated
<dfn data-export for=request id=concept-request-target-browsing-context>target browsing context</dfn>
(null or a <a spec=html>browsing context</a>). Unless stated otherwise it is null.

<p id=keep-alive-flag>A <a for="/">request</a> has an associated
<dfn>keepalive flag</dfn>. Unless stated otherwise it is unset.

Expand Down

0 comments on commit c949f0d

Please sign in to comment.