-
Notifications
You must be signed in to change notification settings - Fork 27
Change { replace: true } to { history: "replace" } #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We can then introduce { history: "push" } which explicitly errors if we're in a convert-to-replace situation. This also fixes a preexisting omission where we were not properly doing replace navigations before the document is loaded.
@@ -787,7 +810,7 @@ An <dfn>navigation API method navigation</dfn> is a [=struct=] with the followin | |||
|
|||
1. Let |info| be |options|["{{NavigationOptions/info}}"] if it exists; otherwise, undefined. | |||
|
|||
1. Let |historyHandling| be "<a for="history handling behavior">`replace`</a>" if |options|["{{NavigationNavigateOptions/replace}}"] is true; otherwise, "<a for="history handling behavior">`default`</a>". | |||
1. Let |historyHandling| be "<a for="history handling behavior">`replace`</a>" if |options|["{{NavigationNavigateOptions/history}}"] is "{{NavigationHistoryBehavior/replace}}" or if |document| is not <a spec="HTML">completely loaded</a>; otherwise, "<a for="history handling behavior">`default`</a>". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat of a bugfix, in the sense that Chromium definitely already did this conversion, and I believe we have tests for it.
In Chromium, by default all before-load navigations are replacements, with a special exception for anchor clicks: see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/local_frame.cc;l=454;drc=a24520a700e2581395920c74d59a918aa60bd5c9 . However in the spec, each call site of the navigate algorithm independently changes historyHandling, except anchor clicks which do not.
Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16
Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16
Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564502 Reviewed-by: Nate Chapin <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#988142}
Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564502 Reviewed-by: Nate Chapin <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#988142}
Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564502 Reviewed-by: Nate Chapin <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#988142}
…history }, a=testonly Automatic update from web-platform-tests Navigation API: change { replace } to { history } Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564502 Reviewed-by: Nate Chapin <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#988142} -- wpt-commits: b905dcaacc78838e9b0a70de4aa7ca9735e2b726 wpt-pr: 33461
…history }, a=testonly Automatic update from web-platform-tests Navigation API: change { replace } to { history } Follows WICG/navigation-api#219. Bug: 1183545 Change-Id: I1e962de093ece36c0f4cdebfcf83a53b4910ea16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564502 Reviewed-by: Nate Chapin <[email protected]> Commit-Queue: Domenic Denicola <[email protected]> Cr-Commit-Position: refs/heads/main@{#988142} -- wpt-commits: b905dcaacc78838e9b0a70de4aa7ca9735e2b726 wpt-pr: 33461
We can then introduce { history: "push" } which explicitly errors if we're in a convert-to-replace situation. Closes #111.
This also fixes a preexisting omission where we were not properly doing replace navigations before the document is loaded.
Preview | Diff