Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 118 additions & 13 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -100193,6 +100193,8 @@ const p2 = navigation.navigate(url2).finished;</code></pre>

<li><p>Set <var>navigation</var>'s <span data-x="concept-Navigation-transition">transition</span>
to null.</p></li>

<li><p>Resolve <var>event</var>'s <span>deferred commit cleanup promise</span>.</p></li>
</ol>
</div>

Expand Down Expand Up @@ -100510,6 +100512,7 @@ interface <dfn interface>NavigateEvent</dfn> : <span>Event</span> {

undefined <span data-x="dom-NavigateEvent-intercept">intercept</span>(optional <span>NavigationInterceptOptions</span> options = {});
undefined <span data-x="dom-NavigateEvent-scroll">scroll</span>();
<span data-x="idl-Promise">Promise</span>&lt;undefined> <span data-x="dom-NavigateEvent-deferCommit">deferCommit</span>(<span data-x="idl-Promise">Promise</span>&lt;undefined> ready);
};

dictionary <dfn dictionary>NavigateEventInit</dfn> : <span>EventInit</span> {
Expand Down Expand Up @@ -100719,6 +100722,14 @@ callback <dfn callback>NavigationInterceptHandler</dfn> = <span data-x="idl-Prom
before the navigation has committed, this method will throw an
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p>
</dd>
<dt><code data-x=""><var>event</var>.<span subdfn data-x="dom-NavigateEvent-deferCommit">scroll</span>(<span data-x="idl-Promise">Promise</span>&lt;undefined>)</code></dt>
<dd>Delays the committing of a same-origin cross-document navigation, without intercepting it as
a same-document navigation. The navigation will commit when promise passed as an argument is
resolved or rejected. This allows setting up some exit animation or performing some asynchronous
exit actions, without the commit aborting those actions in the middle. The returned <span
data-x="idl-Promise">Promise</span> resolves after the last frame of the current document has
been rendered, or if the navigation was aborted, allowing the author to clean up any intermediate
state at that point.</dd>
</dl>

<div w-nodev>
Expand All @@ -100738,6 +100749,12 @@ callback <dfn callback>NavigationInterceptHandler</dfn> = <span data-x="idl-Prom
data-x="concept-NavigateEvent-navigation-handler-list">navigation handler list</dfn>, a
<span>list</span> of <code>NavigationInterceptHandler</code> callbacks, initially empty.</p>

<p>Each <code>NavigateEvent</code> has a <dfn>deferred commit promise list</dfn>, a
<span>list</span> of promise objects, initially empty.</p>

<p>Each <code>NavigateEvent</code> has a <dfn>deferred commit cleanup promise</dfn>, a promise
object, initially a new promise.</p>

<p>Each <code>NavigateEvent</code> has a <dfn data-x="concept-NavigateEvent-focusReset">focus
reset behavior</dfn>, a <code>NavigationFocusReset</code>-or-null, initially null.</p>

Expand Down Expand Up @@ -100771,10 +100788,10 @@ callback <dfn callback>NavigationInterceptHandler</dfn> = <span data-x="idl-Prom
data-x="dom-NavigateEvent-downloadRequest">downloadRequest</code></dfn>, <dfn attribute
for="NavigateEvent"><code data-x="dom-NavigateEvent-info">info</code></dfn>, <dfn attribute
for="NavigateEvent"><code
data-x="dom-NavigateEvent-hasUAVisualTransition">hasUAVisualTransition</code></dfn>, and
<dfn attribute for="NavigateEvent"><code
data-x="dom-NavigateEvent-sourceElement">sourceElement</code></dfn> attributes
must return the values they are initialized to.</p>
data-x="dom-NavigateEvent-hasUAVisualTransition">hasUAVisualTransition</code></dfn>, and <dfn
attribute for="NavigateEvent"><code
data-x="dom-NavigateEvent-sourceElement">sourceElement</code></dfn> attributes must return the
values they are initialized to.</p>
</div>

<div algorithm>
Expand Down Expand Up @@ -100883,6 +100900,42 @@ callback <dfn callback>NavigationInterceptHandler</dfn> = <span data-x="idl-Prom
</ol>
</div>

<div algorithm>
<p>The <dfn method for="NavigateEvent"><code
data-x="dom-NavigateEvent-deferCommit">deferCommit(<var>readyPromise</var>)</code></dfn> method
steps are:</p>

<ol>
<li><p><span data-x="NavigateEvent-perform-shared-checks">Perform shared checks</span> given
<span>this</span>.</p></li>

<li><p>If <span>this</span>'s <code data-x="dom-NavigateEvent-canIntercept">canIntercept</code>
attribute was initialized to false, then throw a <span>"<code>SecurityError</code>"</span>
<code>DOMException</code>.</p></li>

<li><p>If <span>this</span>'s <span>dispatch flag</span> is unset, then throw an
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>If <span>this</span>'s <span
data-x="concept-NavigateEvent-interception-state">interception state</span> is not "<code
data-x="">none</code>", then throw an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code>.</p></li>

<li><p><span data-x="list append">Append</span> <var>readyPromise</var> to <span>this</span>'s
<span>deferred commit promise list</span>.</p></li>

<li><p>Let <var>cleanupPromise</var> be a new promise in <span>this</span>'s <span
data-x="concept-relevant-realm">relevant realm</span>.</p></li>

<li><p><span>Wait for all</span> « <var>readyPromise</var>, <span>this</span>'s <span>deferred
commit cleanup promise</span> », with the following as both the success and failure step: resolve
<var>cleanupPromise</var>.</p></li>

<li><p>Return <var>cleanupPromise</var>.</p></li>
</ol>

</div>

<div algorithm>
<p>To <dfn data-x="NavigateEvent-perform-shared-checks">perform shared checks</dfn> for a
<code>NavigateEvent</code> <var>event</var>:</p>
Expand Down Expand Up @@ -101278,7 +101331,8 @@ interface <dfn interface>NavigationDestination</dfn> {
state</span>-or-null <dfn
data-x="fire-navigate-prr-classicHistoryAPIState"><var>classicHistoryAPIState</var></dfn> (default
null), and an optional <span>navigation API method tracker</span>-or-null <dfn
data-x="fire-navigate-prr-api-method-tracker"><var>apiMethodTracker</var></dfn>:</p>
data-x="fire-navigate-prr-api-method-tracker"><var>apiMethodTracker</var></dfn> (default
null):</p>

<ol>
<li><p>Let <var>document</var> be <var>navigation</var>'s <span>relevant global object</span>'s <span
Expand Down Expand Up @@ -101546,6 +101600,8 @@ interface <dfn interface>NavigationDestination</dfn> {
transition, to display a cached rendered state of the <var>document</var>'s <span>latest
entry</span>, was done by the user agent. Otherwise, initialize it to false.</p></li>

<li><p>Let <var>destinationDocument</var> be.</p></li>

<li><p>Initialize <var>event</var>'s <code
data-x="dom-NavigateEvent-sourceElement">sourceElement</code> to
<var>sourceElement</var>.</p></li>
Expand Down Expand Up @@ -106387,6 +106443,10 @@ location.href = '#foo';</code></pre>
data-x="navigate-fragid">navigate to a fragment</span> path.</p>
</li>

<li><p>Let <var>deferringCommit</var> be true if <var>navigation</var>'s <span>ongoing <code
data-x="event-navigate">navigate</code> event</span>'s <span>deferred commit promise list</span>
is non-empty; Otherwise false.</p></li>

<li><p>If <var>sourceDocument</var> is <var>navigable</var>'s <span
data-x="nav-container-document">container document</span>, then <span>reserve deferred fetch
quota</span> for <var>navigable</var>'s <span data-x="nav-container">container</span> given
Expand Down Expand Up @@ -106575,8 +106635,9 @@ location.href = '#foo';</code></pre>
data-x="dom-navigationtimingtype-navigate">navigate</code>", <var>sourceSnapshotParams</var>,
<var>targetSnapshotParams</var>, <var>userInvolvement</var>, <var>navigationId</var>,
<var>navigationParams</var>, <var>cspNavigationType</var>, with <i
data-x="attempt-to-populate-allow-post">allowPOST</i> set to true and <i
data-x="attempt-to-populate-completion-steps">completionSteps</i> set to the following
data-x="attempt-to-populate-allow-post">allowPOST</i> set to true, <i
data-x="attempt-to-populate-defer-commit">deferCommit</i> set to <var>deferringCommit</var>,
and <i data-x="attempt-to-populate-completion-steps">completionSteps</i> set to the following
step:</p>

<ol>
Expand Down Expand Up @@ -107953,8 +108014,9 @@ location.href = '#foo';</code></pre>
(default null), an optional <span>navigation params</span>-or-null <var>navigationParams</var>
(default null), an optional string <var>cspNavigationType</var> (default "<code
data-x="">other</code>"), an optional boolean <dfn
data-x="attempt-to-populate-allow-post"><var>allowPOST</var></dfn> (default false), and optional
algorithm steps <dfn
data-x="attempt-to-populate-allow-post"><var>allowPOST</var></dfn> (default false), an optional
boolean <dfn data-x="attempt-to-populate-defer-commit"><var>deferCommit</var></dfn> (default
false), and optional algorithm steps <dfn
data-x="attempt-to-populate-completion-steps"><var>completionSteps</var></dfn> (default an empty
algorithm):</p>

Expand Down Expand Up @@ -108036,14 +108098,14 @@ location.href = '#foo';</code></pre>
</ol>
</li>

<li id="process-a-navigate-response">
<p><span>Queue a global task</span> on the <span>navigation and traversal task source</span>,
given <var>navigable</var>'s <span>active window</span>, to run these steps:</p>
<li>
<p>Let <dfn data-x="process a navigate response"><var>processNavigateResponse</var></dfn> be to
<span>queue a global task</span> on the <span>navigation and traversal task source</span>, given
<var>navigable</var>'s <span>active window</span>, to run these steps:</p>

<ol>
<li><p>If <var>navigable</var>'s <span>ongoing navigation</span> no longer equals
<var>navigationId</var>, then run <var>completionSteps</var> and abort these steps.</p></li>

<li>
<p>Let <var>saveExtraDocumentState</var> be true.</p>

Expand Down Expand Up @@ -108265,6 +108327,19 @@ location.href = '#foo';</code></pre>
<li><p>Run <var>completionSteps</var>.</p></li>
</ol>
</li>

<li>
<p>If <var>deferringCommit</var> is true, then <span>defer navigation commit</span> given
<var>navigable</var>, <var>navigationId</var>, and the following steps:</p>

<ol>
<li><p>Call <var>processNavigateResponse</var>.</p></li>

<li><p>Set <var>processNavigateResponse</var> to an empty algorithm.</p></li>
</ol>
</li>

<li><p>Otherwise, call <var>processNavigateResponse</var>.</p></li>
</ol>
</div>

Expand Down Expand Up @@ -109062,6 +109137,36 @@ location.href = '#foo';</code></pre>
</ol>
</div>

<div algorithm>
<p>To <dfn>defer navigation commit</dfn> given a <span>navigable</span> <var>navigable</var>, a
<span>navigation ID</span> <var>navigationID</var>, and an algorithm <var>proceed</var>:</p>

<ol>
<li><p>Let <var>document</var> be <var>navigable</var>'s <span data-x="nav-document">active
document</span>.</p></li>

<li>
<p><span>Queue a task</span> on the <span>DOM manipulation task source</span> given
<var>document</var>'s <span>relevant global object</span> to run the steps:</p>

<ol>
<li><p>If <var>navigable</var> <span>ongoing navigation</span> is not <var>navigationID</var>,
then call <var>proceed</var> and abort these steps.</p></li>

<li><p>Let <var>event</var> be <var>document</var>'s <span>relevant global object</span>'s
<span data-x="window-navigation-api">navigation API</span>'s <span>ongoing <code
data-x="event-navigate">navigate</code> event</span>.</p></li>

<li><p><span data-x="AbortSignal-add">Add</span> <var>proceed</var> to <var>event</var>'s <code
data-x="dom-NavigateEvent-signal">signal</code>.</p></li>

<li><p><span>Wait for all</span> <var>event</var>'s <span>deferred commit promise list</span>,
with <var>proceed</var> as both the success and failure steps.</p></li>
</ol>
</li>
</ol>
</div>

<div algorithm>
<p>An element has a <dfn>browsing context scope origin</dfn> if its <code>Document</code>'s
<span>node navigable</span> is a <span>top-level traversable</span> or if all of its
Expand Down