Skip to content

Commit

Permalink
Add Request's isHistoryNavigation
Browse files Browse the repository at this point in the history
And also a member on the request concept (history-navigation flag) to support this API. See w3c/ServiceWorker#1167 for the discussion that led to this.

Tests: web-platform-tests/wpt#10909.

Corresponding HTML change: whatwg/html#3674.
  • Loading branch information
yutakahirano authored and annevk committed May 29, 2018
1 parent efe088f commit bd9b4e3
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions fetch.bs
Expand Up @@ -1150,6 +1150,12 @@ Unless stated otherwise, it is unset.

<p class="note no-backref">This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]]

<p>A <a for=/>request</a> has an associated
<dfn export for=request id=concept-request-history-navigation-flag>history-navigation flag</dfn>.
Unless stated otherwise, it is unset.

<p class="note no-backref">This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]]

<hr>

<p>A <a for=/>request</a> has an associated
Expand Down Expand Up @@ -4976,6 +4982,7 @@ interface Request {
readonly attribute DOMString integrity;
readonly attribute boolean keepalive;
readonly attribute boolean isReloadNavigation;
readonly attribute boolean isHistoryNavigation;
readonly attribute AbortSignal signal;

[NewObject] Request clone();
Expand Down Expand Up @@ -5136,6 +5143,10 @@ initially a new {{AbortSignal}} object.
<dt><code><var>request</var> . <a attribute for=Request>isReloadNavigation</a></code>
<dd>Returns a boolean indicating whether or not <var>request</var> is for a reload navigation.

<dt><code><var>request</var> . <a attribute for=Request>isHistoryNavigation</a></code>
<dd>Returns a boolean indicating whether or not <var>request</var> is for a history
navigation (a.k.a. back-foward navigation).

<dt><code><var>request</var> . <a attribute for=Request>signal</a></code>
<dd>Returns the signal associated with <var>request</var>, which is an
{{AbortSignal}} object indicating whether or not <var>request</var> has been aborted, and its abort
Expand Down Expand Up @@ -5239,10 +5250,11 @@ constructor must run these steps:
<a for=request>integrity metadata</a> is
<var>request</var>'s
<a for=request>integrity metadata</a>,
<a>keepalive flag</a> is <var>request</var>'s <a>keepalive flag</a>, and
<a>keepalive flag</a> is <var>request</var>'s <a>keepalive flag</a>,
<a for=request>reload-navigation flag</a> is <var>request</var>'s
<a for=request>reload-navigation flag</a>.

<a for=request>reload-navigation flag</a>, and
<a for=request>history-navigation flag</a> is <var>request</var>'s
<a for=request>history-navigation flag</a>.

<li>
<p>If any of <var>init</var>'s members are present, then:
Expand All @@ -5254,6 +5266,8 @@ constructor must run these steps:

<li><p>Unset <var>request</var>'s <a for=request>reload-navigation flag</a>.

<li><p>Unset <var>request</var>'s <a for=request>history-navigation flag</a>.

<li><p>Set <var>request</var>'s <a for=request>referrer</a> to
"<code>client</code>"

Expand Down Expand Up @@ -5534,6 +5548,10 @@ is set, and false otherwise.
invoked, must return true if the <a>context object</a>'s <a for=Request>request</a>'s
<a for=request>reload-navigation flag</a> is set, and false otherwise.

<p>The <dfn attribute for=Request><code>isHistoryNavigation</code></dfn> attribute's getter, when
invoked, must return true if the <a>context object</a>'s <a for=Request>request</a>'s
<a for=request>history-navigation flag</a> is set, and false otherwise.

<p>The <dfn attribute for=Request><code>signal</code></dfn> attribute's getter must return the
associated <a for="Request">signal</a>.

Expand Down

0 comments on commit bd9b4e3

Please sign in to comment.