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
76 changes: 35 additions & 41 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -100222,10 +100222,38 @@ const p2 = navigation.navigate(url2).finished;</code></pre>
<li><p>Let <var>navigation</var> be <var>navigable</var>'s <span data-x="nav-window">active
window</span>'s <span data-x="window-navigation-api">navigation API</span>.</p></li>

<li><p>If <var>navigation</var>'s <span>ongoing <code data-x="event-navigate">navigate</code>
event</span> is null, then return.</p></li>
<li>
<p><span>While</span> <var>navigation</var>'s <span>ongoing <code
data-x="event-navigate">navigate</code> event</span> is not null:</p>

<ol>
<li><p><span>Abort the ongoing navigation</span> given <var>navigation</var>.</p></li>
</ol>

<div class="note">
<p>If there is an ongoing cross-document navigation, this means it will be signaled to the
navigation API as aborted, e.g., by firing <code
data-x="event-navigateerror">navigateerror</code> events. This is somewhat accurate, since the
next navigation the <code>Document</code> experiences will be this same-document navigation, so
a developer which was expecting the next navigation completion to be that of the cross-document
navigation gets a useful signal that this did not happen. However, it is also somewhat
inaccurate, as the browser will continue to process the ongoing cross-document navigation
(applying it after this same-document one synchronously finishes).</p>

<p>Ultimately, the navigation API gets a bit messy with overlapping cross- and same-document
navigations, as the <a href="#ongoing-navigation-tracking">ongoing navigation tracking</a>
machinery and APIs are built to expose only a single ongoing navigation. Web developers will be
best-served if they do not create such overlapping situations, e.g., by <code
data-x="">await</code>ing promises returned from <code
data-x="dom-Navigation-navigate">navigation.navigate()</code> before starting new
navigations.</p>
</div>

<li><p><span>Abort the ongoing navigation</span> given <var>navigation</var>.</p></li>
<p class="note">This is a loop, since <span>abort the ongoing navigation</span> can run
JavaScript (e.g., via the <code data-x="event-navigateerror">navigateerror</code> event), which
might start a new navigation. Since such a newly-started navigation will be superseded by the
completion of this navigation, it gets signaled to the navigation API as aborted.</p>
</li>
</ol>
</div>

Expand Down Expand Up @@ -101264,44 +101292,10 @@ interface <dfn interface>NavigationDestination</dfn> {
null):</p>

<ol>
<li>
<p>If <var>isSameDocument</var> is true:</p>

<ol>
<li>
<p><span>While</span> <var>navigation</var>'s <span>ongoing <code
data-x="event-navigate">navigate</code> event</span> is not null:</p>

<ol>
<li><p><span>Abort the ongoing navigation</span> given <var>navigation</var>.</p></li>
</ol>

<div class="note">
<p>If there is an ongoing cross-document navigation, this means it will be signaled to the
navigation API as aborted, e.g., by firing <code
data-x="event-navigateerror">navigateerror</code> events. This is somewhat accurate, since
the next navigation the <code>Document</code> experiences will be this same-document
navigation, so a developer which was expecting the next navigation completion to be that of
the cross-document navigation gets a useful signal that this did not happen. However, it is
also somewhat inaccurate, as the browser will continue to process the ongoing cross-document
navigation (applying it after this same-document one synchronously finishes).</p>

<p>Ultimately, the navigation API gets a bit messy with overlapping cross- and same-document
navigations, as the <a href="#ongoing-navigation-tracking">ongoing navigation tracking</a>
machinery and APIs are built to expose only a single ongoing navigation. Web developers will
be best-served if they do not create such overlapping situations, e.g., by <code
data-x="">await</code>ing promises returned from <code
data-x="dom-Navigation-navigate">navigation.navigate()</code> before starting new
navigations.</p>
</div>

<p class="note">This is a loop, since <span>abort the ongoing navigation</span> can run
JavaScript (e.g., via the <code data-x="event-navigateerror">navigateerror</code> event),
which might start a new navigation. Since such a newly-started navigation will be superseded
by the completion of this navigation, it gets signaled to the navigation API as aborted.</p>
</li>
</ol>
</li>
<li><p><span>Inform the navigation API about aborting navigation</span> in
<var>navigation</var>'s <span>relevant global object</span>'s <span
data-x="concept-document-window">associated <code>Document</code></span>'s <span>node
navigable</span>.</p></li>

<li><p>Let <var>event</var> be the result of <span>creating an event</span> given
<code>NavigateEvent</code>, in <var>navigation</var>'s <span
Expand Down