Skip to content

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Sep 24, 2025

Add NavigationTransition.to, exposing the current navigate event's destination.

This was not necessary before as navigations were committed synchronously, but with precommit handlers this
exposes information about an ongoing navigation.

The destination is set when the NavigationTransition object is created, and remains stable throughout.

Closes #11690.

(See WHATWG Working Mode: Changes for more details.)


/nav-history-apis.html ( diff )

@noamr noamr changed the title Navigation transition to Add NavigationTransition.to, exposing the current navigate event's destination Sep 24, 2025
@noamr noamr force-pushed the navigation-transition-to branch from 3336abd to 50e0a20 Compare September 24, 2025 12:15
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was easier than I thought it would be, nice.

source Outdated
<dt><code data-x=""><span data-x="dom-navigation">navigation</span>.<span data-x="dom-Navigation-transition">transition</span>.<span subdfn data-x="dom-NavigationTransition-to">to</span></code></dt>
<dd><p>The <code>NavigationDestination</code> of the transition. This can be useful to compare
against <code data-x="dom-Navigation-currentEntry">navigation.currentEntry</code> before the
navigation is <span data-x="concept-NavigationTransition-committed">committed</span>.</p></dd>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "compare against" makes it sound like === will work, which it will not. I'm not sure what the best rephrasing is...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something along the lines of competing the different properties of the entry and destination

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded a bit

@noamr noamr force-pushed the navigation-transition-to branch from 50e0a20 to 7036eef Compare September 25, 2025 08:27
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 25, 2025
This exposes the destination of an ongoing navigation.

Spec PR: whatwg/html#11692
I2P: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/68d4ff4d.2b0a0220.29ae18.0091.GAE%40google.com

[email protected]

Bug: 447171238
Change-Id: I1d2fbb7c0b7f2656ca4392be4d1beac34d9012ac
aarongable pushed a commit to chromium/chromium that referenced this pull request Sep 25, 2025
This exposes the destination of an ongoing navigation.

Spec PR: whatwg/html#11692
I2P: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/68d4ff4d.2b0a0220.29ae18.0091.GAE%40google.com

[email protected]

Bug: 447171238
Change-Id: I1d2fbb7c0b7f2656ca4392be4d1beac34d9012ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6982944
Reviewed-by: Nate Chapin <[email protected]>
Commit-Queue: Noam Rosenthal <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1520724}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 25, 2025
This exposes the destination of an ongoing navigation.

Spec PR: whatwg/html#11692
I2P: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/68d4ff4d.2b0a0220.29ae18.0091.GAE%40google.com

[email protected]

Bug: 447171238
Change-Id: I1d2fbb7c0b7f2656ca4392be4d1beac34d9012ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6982944
Reviewed-by: Nate Chapin <[email protected]>
Commit-Queue: Noam Rosenthal <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1520724}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 25, 2025
This exposes the destination of an ongoing navigation.

Spec PR: whatwg/html#11692
I2P: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/68d4ff4d.2b0a0220.29ae18.0091.GAE%40google.com

[email protected]

Bug: 447171238
Change-Id: I1d2fbb7c0b7f2656ca4392be4d1beac34d9012ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6982944
Reviewed-by: Nate Chapin <[email protected]>
Commit-Queue: Noam Rosenthal <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1520724}
@noamr
Copy link
Collaborator Author

noamr commented Oct 1, 2025

@zcorpan can I mark it as "two implementers interested"? People said it was reasonable but I want to make sure. If so, I'll open implementation bugs and fill in the rest of the checkboxes.

@zcorpan
Copy link
Member

zcorpan commented Oct 1, 2025

Yes. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add to or destination to NavigationTransition
4 participants