Skip to content
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

Specify event.signal #119

Merged
merged 1 commit into from
Jun 17, 2021
Merged

Specify event.signal #119

merged 1 commit into from
Jun 17, 2021

Conversation

domenic
Copy link
Collaborator

@domenic domenic commented May 25, 2021

Detailed semantics/tests to write:

  • Mainline cases:
    • Doing pushState/replaceState, or anything that goes through HTML's "navigate", will synchronously cause the signal to fire abort. This is true even if you're in the middle of a navigate event handler (perhaps one of many event handlers); it doesn't wait until the end.
    • Doing HTML's "traverse the history" will in theory asynchronously cause the event to fire because of how the spec is written, but I don't think I like this very much, and all the history traversal stuff is going to be rewritten for navigate events on traversal #114 / Specify traversal and overhaul ongoing navigation tracking #109 anyway, so I dunno.
    • window.stop() will synchronously cause the signal to fire abort.
    • Clicking the stop button will cause the signal to fire abort, since that cancels ongoing navigations.
    • In all of the above cases, the abort happens synchronously and immediately, but other consequences such as navigateerror happen asynchronously at the bottom of the "inner navigate event firing algorithm"
  • Degenerate cases:
    • Disconnecting an iframe during any navigate event handler will cause the signal to fire abort
    • Calling event.preventDefault() in any navigate event handler will cause the signal to fire abort
    • In both of the above cases, the abort fires after all event handlers have run (not immediately upon the action), but synchronously. Then, after a microtask, navigateerror fires on appHistory.
    • document.open() cancels navigations and should have a similar impact to window.stop(), synchronously. Although Clarify how to cancel a navigation whatwg/html#3447 makes me a bit suspicious.

Preview | Diff

@domenic domenic requested a review from natechapin May 25, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants