Skip to content

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Sep 30, 2025

Use "Inform the navigation API about aborting navigation" when possible.
Refactor it to loop and abort navigation until the event is nullified.
Call it also from reload and cross-document navigation code paths - which fixes existing asserts mentioned in #11714 .

Closes #11579

  • At least two implementers are interested (and none opposed):
    • Bugfix
  • Tests are written and can be reviewed and commented upon at:
    Already exercised by navigation-api/state/location-reload.html and navigation-api/navigation-methods/reload-no-args.html
  • Implementation bugs are filed:
    • N/A. Should already be implemented, otherwise things will assert.
  • Corresponding HTML AAM & ARIA in HTML issues & PRs: Not needed
  • MDN issue is filed: Not needed
  • The top of this comment includes a clear commit message to use.

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


/nav-history-apis.html ( diff )

Use "Inform the navigation API about aborting navigation" when possible
Refactor it to loop and abort navigation until the event is nullified.

Closes whatwg#11579
@zcorpan
Copy link
Member

zcorpan commented Sep 30, 2025

The removal of the isSameDocument check is a normative change (or bug fix), correct?

@noamr
Copy link
Collaborator Author

noamr commented Sep 30, 2025

The removal of the isSameDocument check is a normative change (or bug fix), correct?

It is not, it creates another "no op" path without a normative effect. See #11579 OP which describes it.

@farre
Copy link
Contributor

farre commented Sep 30, 2025

We're definitely fixing a bug here (one that we've needed to fix exactly this way in Gecko), since now with the isSameDocument check removed, it means that #reload will also abort ongoing navigate events.

@noamr
Copy link
Collaborator Author

noamr commented Sep 30, 2025

We're definitely fixing a bug here (one that we've needed to fix exactly this way in Gecko), since now with the isSameDocument check removed, it means that #reload will also abort ongoing navigate events.

Fair enough, so this probably needs the template. Did gecko have a WPT for this at hand?

@zcorpan
Copy link
Member

zcorpan commented Oct 1, 2025

navigation-api/state/location-reload.html and navigation-api/navigation-methods/reload-no-args.html should exercise this.

@noamr noamr changed the title Editorial: consolidate navigation API abort paths Consolidate navigation API abort paths Oct 1, 2025
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.

Navigation API: consolidate aborting code paths
3 participants