-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Navigables: fireNavigateEventOnCommit is unused in apply the history step #9800
Comments
Step 14.11.2 of apply the history step also doesn't say where to get the navigation API from, whereas 4.3.5.3 of check if unloading is canceled says to get it from the traversible's active window. |
I believe the intent here is to only fire the "early" version of the The current spec says those circumstances are:
I think the intention of the spec was to add the condition
by using a boolean passed in from the wrapper algorithms. Which would obviate the first condition above, which is why I'm a bit suspicious of it. But then I'm wondering what the connection is between these conditions under which
@natechapin, can you help me remember which condition we implemented in Chromium for when the event fires "early"? I tried poking through the code but much of the context has fallen out of my head... |
We should only fire "early" for traversal afaik. If I'm reading the spec correctly, there's some subtlety here. We only "check if unloading is canceled" in the step 5 of "apply the history step" if |
In #9826 I walked through what happens for navigate to a fragment (including an assertion failure in the navigation API), which eventually ends up in apply the history step with that argument set to "false", because we already fired a navigate event in step 3 of that algorithm. I'm not sure if that's completely correct? It's hard to trace how fragment navigations flow through apply the history step for me. |
Thanks @natechapin for confirming. So the desired state is:
What the spec currently implements:
So I think the only issue is the leftover fireNavigateEventOnCommit. I will remove it with a clean conscience, and then move on to @ADKaster's other spec issues. |
* Remove the unused fireNavigateEventOnCommit argument. Closes #9800. * Fix "apply the reload history step"'s declaration to match its call site. * Add the missing anchor for descendant navigable traversal navigate events. * Make the linking text clearer for a note that referenced a specific part of the "apply the history step" algorithm.
* Remove the unused fireNavigateEventOnCommit argument. Closes #9800. * Fix "apply the reload history step"'s declaration to match its call site. * Add the missing anchor for descendant navigable traversal navigate events. * Make the linking text clearer for a note that referenced a specific part of the "apply the history step" algorithm.
In https://html.spec.whatwg.org/multipage/browsing-the-web.html#apply-the-history-step, the argument
fireNavigateEventOnCommit
is not used.Instead, it appears that the logic for whether to fire a traverse navigation event on commit happens in step 14.11.2, inside a queued global task:
A traverse navigation event is also fired from step 5 of apply the history step under a similar check in step 4.3 of the algorithm for checking if unloading is canceled. https://html.spec.whatwg.org/multipage/browsing-the-web.html#checking-if-unloading-is-canceled:
... and step 4.3.5.4 of checking if unloading is canceled fires the actual event:
The text was updated successfully, but these errors were encountered: