Skip to content

Commit cac111e

Browse files
committed
Refine duplicate navigation check
1 parent 8b01b14 commit cac111e

1 file changed

Lines changed: 119 additions & 31 deletions

File tree

‎source‎

Lines changed: 119 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11850,10 +11850,21 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
1185011850
the user agent must do nothing. Otherwise, if the <code>Document</code>'s <span
1185111851
data-x="concept-document-origin">origin</span> is an <span data-x="concept-origin-opaque">opaque
1185211852
origin</span>, the user agent must throw a <span>"<code>SecurityError</code>"</span>
11853-
<code>DOMException</code>. Otherwise, the user agent must act as it would when <span
11854-
data-x="receives a set-cookie-string">receiving a set-cookie-string</span> for the document's
11855-
<span data-x="concept-document-url">URL</span> via a "non-HTTP" API, consisting of the new value
11856-
<span data-x="utf-8 encode">encoded as UTF-8</span>. <ref>COOKIES</ref> <ref>ENCODING</ref></p>
11853+
<code>DOMException</code>. Otherwise:</p>
11854+
11855+
<ol>
11856+
<li>
11857+
<p>Set this <code>Document</code>'s <span>navigable</span>'s <span>navigation conditions potentially changed</span> to true.</p>
11858+
<p class="note">Other operations that could set cookies, such as the <a href="https://wicg.github.io/cookie-store/">Cookie Store API</a> or receiving a Set-Cookie header in a fetch response, also cause the <span>navigation conditions potentially changed</span> to be set to true.</p>
11859+
</li>
11860+
11861+
<li><p>The user agent must act as it would when <span
11862+
data-x="receives a set-cookie-string">receiving a set-cookie-string</span> for the document's
11863+
<span data-x="concept-document-url">URL</span> via a "non-HTTP" API, consisting of the new value
11864+
<span data-x="utf-8 encode">encoded as UTF-8</span>. <ref>COOKIES</ref> <ref>ENCODING</ref></p>
11865+
</li>
11866+
11867+
</ol>
1185711868
</div>
1185811869

1185911870
<p class="note">Since the <code data-x="dom-document-cookie">cookie</code> attribute is accessible
@@ -103968,6 +103979,11 @@ interface <dfn interface>NotRestoredReasons</dfn> {
103968103979

103969103980
<p class="note">This is only ever set to true in cases where the navigable's <span
103970103981
data-x="nav-parent">parent</span> is non-null.</p>
103982+
</li>
103983+
103984+
<li><p>A <dfn data-x="nav-initiation-snapshot">navigation initiation snapshot params</dfn>, a <span>navigation initiation snapshot params</span>.</p></li>
103985+
103986+
<li><p>A <dfn>navigation conditions potentially changed</dfn> boolean, initially false.</p></li>
103971103987
</ul>
103972103988

103973103989
<p>The <span data-x="nav-current-history-entry">current session history entry</span> and the
@@ -106835,6 +106851,35 @@ location.href = '#foo';</code></pre>
106835106851

106836106852
<hr>
106837106853

106854+
<p>The <dfn>navigation initiation snapshot params</dfn> <span>struct</span> is used to capture
106855+
the state of a navigation at its beginning for deduplication purposes. It has the following
106856+
<span data-x="struct item">items</span>:</p>
106857+
106858+
<dl>
106859+
<dt><dfn data-x="nav-initiation-snapshot-params-url">url</dfn></dt>
106860+
<dd>A <span>URL</span></dd>
106861+
106862+
<dt><dfn data-x="nav-initiation-snapshot-params-origin">initiator origin</dfn></dt>
106863+
<dd>an <span>origin</span> or null
106864+
106865+
<dt><dfn data-x="nav-initiation-snapshot-params-nav-start-time">navigation start time</dfn></dt>
106866+
<dd>a number
106867+
106868+
<dt><dfn data-x="nav-initiation-snapshot-params-uni">user navigation involvement</dfn></dt>
106869+
<dd>an <span>user navigation involvement</span>
106870+
106871+
<dt><dfn data-x="nav-initiation-snapshot-params-referrer-policy">referrer policy</dfn></dt>
106872+
<dd>a <span>referrer policy</span>
106873+
106874+
<dt><dfn data-x="nav-initiation-snapshot-params-history-handling">history handling behavior</dfn></dt>
106875+
<dd>a <code>NavigationHistoryBehavior</code>
106876+
106877+
<dt><dfn data-x="nav-initiation-snapshot-params-entry-list">entry list</dfn></dt>
106878+
<dd>an <span>entry list</span> or null
106879+
</dl>
106880+
106881+
<hr>
106882+
106838106883
<p>Much of the navigation process is concerned with determining how to create a new
106839106884
<code>Document</code>, which ultimately happens in the <span
106840106885
data-x="create-the-document-object">create and initialize a <code>Document</code> object</span>
@@ -107058,6 +107103,8 @@ location.href = '#foo';</code></pre>
107058107103
data-x="navigation-api-method-tracker"><var>apiMethodTracker</var></dfn> (default null):</p>
107059107104

107060107105
<ol>
107106+
<li><p>Set <var>navigationStartTime</var> to the <span>unsafe shared current time</span>.</p></li>
107107+
107061107108
<li><p>Let <var>cspNavigationType</var> be "<code data-x="">form-submission</code>" if
107062107109
<var>formDataEntryList</var> is non-null; otherwise "<code data-x="">other</code>".</p></li>
107063107110

@@ -107240,40 +107287,81 @@ location.href = '#foo';</code></pre>
107240107287
</li>
107241107288

107242107289
<li>
107243-
<p>If <var>navigable</var>'s <span>ongoing navigation</span> is not null, and all of the following
107244-
are true:</p>
107290+
<p>If <var>navigable</var>'s <span>ongoing navigation</span> is not null:</p>
107291+
<ol>
107292+
<li><p>Let <var>navigationInitiationSnapshotParams</var> be <var>navigable</var>'s
107293+
<span>navigation initiation snapshot params</span>.</p></li>
107294+
<li><p>If all of the following are true:</p><ul>
107245107295

107246-
<ul>
107247-
<li>
107248-
<p>the time elapsed since the ongoing navigation was initiated is within a
107249-
user-agent-defined threshold;</p>
107250-
</li>
107251-
<li>
107252-
<p>both the new and ongoing navigations are HTTP GET requests, and the new navigation is not
107253-
a form submission;</p>
107254-
</li>
107255-
<li>
107256-
<p>the navigations have an identical <var>url</var>, <span
107257-
data-x="document-state-initiator-origin">initiator origin</span>, <span
107258-
data-x="document-state-request-referrer">referrer</span>, <span
107259-
data-x="document-state-request-referrer-policy">request referrer policy</span>,
107260-
<var>userInvolvement</var>, <var>historyHandling</var>, and request headers,</p>
107261-
</li>
107262-
</ul>
107263-
<p>then:</p>
107296+
<li><p>If <var>navigationStartTime</var> minus <var>navigationInitiationSnapshotParams</var>'s
107297+
<span data-x="nav-initiation-snapshot-params-nav-start-time">navigation start time</span> is
107298+
less than a user-agent provided threshold;</p></li>
107264107299

107265-
<ol>
107266-
<li>
107267-
<p>Invoke <span>WebDriver BiDi navigation failed</span> with <var>navigable</var> and a new
107300+
<li><p><var>cspNavigationType</var> is "<code data-x="">other</code>" and
107301+
<var>navigationInitiationSnapshotParams</var>'s <span
107302+
data-x="nav-initiation-snapshot-params-entry-list">entry list</span> is null;</p></li>
107303+
107304+
<li><p><var>url</var> <span data-x="concept-url-equals">equals</span>
107305+
<var>navigationInitiationSnapshotParams</var>'s <span
107306+
data-x="nav-initiation-snapshot-params-url">url</span>;</p></li>
107307+
107308+
<li><p><var>initiatorOriginSnapshot</var> is <code data-x="">same-origin</code> with
107309+
<var>navigationInitiationSnapshotParams</var>'s <span
107310+
data-x="nav-initiation-snapshot-params-origin">origin</span>;</p></li>
107311+
107312+
<li><p><var>referrerPolicy</var> is <var>navigationInitiationSnapshotParams</var>'s <span
107313+
data-x="nav-initiation-snapshot-params-referrer-policy">referrer policy</span>;</p></li>
107314+
107315+
<li><p><var>userInvolvement</var> is <var>navigationInitiationSnapshotParams</var>'s <span
107316+
data-x="nav-initiation-snapshot-params-uni">user navigation involvement</span>;</p></li>
107317+
107318+
<li><p><var>historyHandling</var> is <var>navigationInitiationSnapshotParams</var>'s <span
107319+
data-x="nav-initiation-snapshot-params-history-handling">history handling behavior</span>;</p></li>
107320+
107321+
<li><p>the <var>navigable</var>'s <span>navigation conditions potentially changed</span> is
107322+
false;</p></li>
107323+
107324+
</ul>
107325+
<p>then:</p>
107326+
<ol>
107327+
<li><p>Invoke <span>WebDriver BiDi navigation failed</span> with <var>navigable</var> and a new
107268107328
<span>WebDriver BiDi navigation status</span> whose <span
107269107329
data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
107270107330
data-x="navigation-status-status">status</span> is "<code
107271107331
data-x="navigation-status-canceled">canceled</code>", and <span
107272-
data-x="navigation-status-url">url</span> is <var>url</var>.</p>
107273-
</li>
107274-
<li><p>Return.</p></li>
107332+
data-x="navigation-status-url">url</span> is <var>url</var>.</p></li>
107333+
<li><p>Return.</p></li>
107334+
</ol>
107275107335
</ol>
107276-
</li>
107336+
107337+
<li><p>Set <span>navigable</span>'s <span data-x="nav-initiation-snapshot">navigation initiation
107338+
snapshot params</span> to a new <spec>navigation initiation snapshot params</spec>, with</p>
107339+
107340+
<dl class="props">
107341+
<dt><span data-x="nav-initiation-snapshot-params-url">url</span></dt>
107342+
<dd><var>url</var></dd>
107343+
107344+
<dt><span data-x="nav-initiation-snapshot-params-origin">initiator origin</span></dt>
107345+
<dd><var>initiatorOriginSnapshot</var></dd>
107346+
107347+
<dt><span data-x="nav-initiation-snapshot-params-nav-start-time">navigation start time</span></dt>
107348+
<dd><var>navigationStartTime</var></dd>
107349+
107350+
<dt><span data-x="nav-initiation-snapshot-params-uni">user navigation involvement</span></dt>
107351+
<dd><var>userInvolvement</var></dd>
107352+
107353+
<dt><span data-x="nav-initiation-snapshot-params-referrer-policy">referrer policy</span></dt>
107354+
<dd><var>referrerPolicy</var></dd>
107355+
107356+
<dt><span data-x="nav-initiation-snapshot-params-history-handling">history handling behavior</span></dt>
107357+
<dd>a <code>historyHandling</code>
107358+
107359+
<dt><span data-x="nav-initiation-snapshot-params-entry-list">entry list</span></dt>
107360+
<dd><var>formDataEntryList</var></dd>
107361+
</dl></li>
107362+
107363+
<li><p>Set <span>navigable</span>'s <span>navigation conditions potentially changed</span> to
107364+
false.</p></li>
107277107365

107278107366
<li>
107279107367
<p><span>Set the ongoing navigation</span> for <var>navigable</var> to

0 commit comments

Comments
 (0)