Skip to content

Commit

Permalink
Set request's history-navigation flag for history traversal
Browse files Browse the repository at this point in the history
See w3c/ServiceWorker#1167 for the discussion that led to this change and
whatwg/fetch#718 for the infrastructure in Fetch this builds upon.

Also includes minor editorial changes to the "traverse the history"
algorithm.

Tests: web-platform-tests/wpt#10909
  • Loading branch information
yutakahirano authored and domenic committed May 25, 2018
1 parent c33665f commit 437ae8e
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x="concept-request-integrity-metadata" data-x-href="https://fetch.spec.whatwg.org/#concept-request-integrity-metadata">integrity metadata</dfn></li>
<li><dfn data-x="concept-request-parser-metadata" data-x-href="https://fetch.spec.whatwg.org/#concept-request-parser-metadata">parser metadata</dfn></li>
<li><dfn data-x="concept-request-reload-navigation-flag" data-x-href="https://fetch.spec.whatwg.org/#concept-request-reload-navigation-flag">reload-navigation flag</dfn></li>
<li><dfn data-x="concept-request-history-navigation-flag" data-x-href="https://fetch.spec.whatwg.org/#concept-request-history-navigation-flag">history-navigation flag</dfn></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -80471,7 +80472,8 @@ interface <dfn>History</dfn> {
</li>

<li><p><span>Traverse the history</span> of the <var>specified browsing context</var> to
the <var>specified entry</var>.</p>
the <var>specified entry</var> with the <i data-x="history-navigation flag">history-navigation
flag</i> set.</p>

</ol>

Expand Down Expand Up @@ -82810,9 +82812,9 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
unset.</p></li>

<li><p><span>Traverse the history</span> to the new entry, with <span>replacement enabled</span>
if this was invoked with <span>replacement enabled</span>, and with the <i>non-blocking
events</i> flag set. This will <span>scroll to the fragment</span> given in what is now the
document's <span data-x="concept-document-url">URL</span>.</p></li>
if this was invoked with <span>replacement enabled</span>, and with the <i data-x="non-blocking
events flag">non-blocking events flag</i> set. This will <span>scroll to the fragment</span>
given in what is now the document's <span data-x="concept-document-url">URL</span>.</p></li>
</ol>

<p class="note">If the scrolling fails because the relevant <span data-x="concept-id">ID</span> has
Expand Down Expand Up @@ -82939,9 +82941,10 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface

<div w-nodev>

<p>When a user agent is required to <dfn>traverse the history</dfn> to a <span>session history
entry</span> <var>entry</var>, optionally with <span>replacement enabled</span>, and optionally
with the <i>non-blocking events</i> flag set, the user agent must act as follows.</p>
<p>To <dfn>traverse the history</dfn> to a <span>session history entry</span> <var>entry</var>,
optionally with <dfn data-export="">replacement enabled</dfn>, optionally with the
<dfn>non-blocking events flag</dfn> set, and optionally with the <dfn>history-navigation
flag</dfn> set:</p>

<p class="note">This algorithm is not just invoked when <span data-x="traverse the history by a
delta">explicitly going back or forwards in the session history</span> &mdash; it is also invoked
Expand All @@ -82957,6 +82960,10 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">url</span> is <var>entry</var>'s <span>URL</span>.</p></li>

<li><p>If the <i data-x="history-navigation flag">history-navigation flag</i> is set, then set
<var>request</var>'s <span data-x="concept-request-history-navigation-flag">history-navigation
flag</span>.</p></li>

<li>
<p><span>Navigate</span><!--DONAV history traversal after eviction--> the <span>browsing
context</span> to <var>request</var> to perform an <span>entry update</span> of
Expand Down Expand Up @@ -83099,8 +83106,8 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<var>old URL</var> be the <span>current entry</span>'s <span>URL</span> and <var>new URL</var> be
<var>entry</var>'s <span>URL</span>. Otherwise, let <var>hash changed</var> be false.</p></li>

<li><p>If the traversal was initiated with <dfn data-export="">replacement enabled</dfn>, remove
the entry immediately before the <var>specified entry</var> in the session history.</p></li>
<li><p>If the traversal was initiated with <span>replacement enabled</span>, remove the entry
immediately before the <var>specified entry</var> in the session history.</p></li>

<li><p>If <var>entry</var> is not <span>an entry with persisted user state</span>, but its
<span>URL</span>'s <span data-x="concept-url-fragment">fragment</span> is non-null, then
Expand All @@ -83113,7 +83120,7 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<li><p>If <var>entry</var> has <span>serialized state</span>, then let <var>state</var> be
<span>StructuredDeserialize</span>(<var>entry</var>'s <span>serialized state</span>,
<var>targetRealm</var>). If this throws an exception, catch it, ignore the exception, and let
<var>state</var>be null.</p></li>
<var>state</var> be null.</p></li>

<li><p>Otherwise, let <var>state</var> be null.</p></li>

Expand All @@ -83128,9 +83135,10 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface

<li>

<p>If the <i>non-blocking events</i> flag is not set, then run the following substeps
<span>immediately</span>. Otherwise, the <i>non-blocking events</i> flag is set; <span>queue a
task</span> to run the following substeps instead.</p>
<p>If the <i data-x="non-blocking events flag">non-blocking events flag</i> is not set, then run
the following substeps <span>immediately</span>. Otherwise, the <i data-x="non-blocking events
flag">non-blocking events flag</i> flag is set; <span>queue a task</span> to run the following
substeps instead.</p>

<ol>

Expand Down Expand Up @@ -121374,7 +121382,7 @@ INSERT INTERFACES HERE
Yoav Weiss,
Yonathan Randolph,
Yury Delendik,
平野裕 (Yutaka Hirano)
平野裕 (Yutaka Hirano),
Yuzo Fujishima,
Zhenbin Xu,
&#24352;&#26234;&#24378; (Zhiqiang Zhang),
Expand Down

0 comments on commit 437ae8e

Please sign in to comment.