Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Editorial: clean up condition logic in navigate event firing#11987

Merged
zcorpan merged 2 commits intowhatwg:mainfrom
noamr:fix-indent-precommit
Dec 4, 2025
Merged

Editorial: clean up condition logic in navigate event firing#11987
zcorpan merged 2 commits intowhatwg:mainfrom
noamr:fix-indent-precommit

Conversation

@noamr
Copy link
Collaborator

@noamr noamr commented Dec 4, 2025

"commit a navigate event" is a noop when the navigation is not intercepted in the first place.

Instead of calling it and checking for the interception state internally, only call it for intercepted navigations, and rename it to "commit an intercepted navigate event". Also remove internal logic that tests whether the navigation is same-document (intercepted navigations are always same-document).

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


/nav-history-apis.html ( diff )

noamr added 2 commits December 4, 2025 10:56
"commit a navigate event" is a noop when the navigation is not
intercepted in the first place.

Instead of calling it and checking for the interception state
internally, only call it for intercepted navigations, and rename it
to "commit an intercepted navigate event". Also remove internal
logic that tests whether the navigation is same-document
(intercepted navigations are always same-document).
@noamr noamr requested a review from zcorpan December 4, 2025 11:10
@zcorpan
Copy link
Member

zcorpan commented Dec 4, 2025

This seems to indeed be editorial. The precommit handler list should be empty if the interception state is "none".

@zcorpan zcorpan merged commit 3401ce6 into whatwg:main Dec 4, 2025
2 checks passed
noamr added a commit to noamr/html that referenced this pull request Dec 16, 2025
This is a step in "commit an intercepted navigate event" that should be done
when the event is *not* intercepted.

This fixes a bug introduced by whatwg#11952, where accidentally removing an "Otherwise"
results in calling "clean up" also for same-document navigations, and a subsequent
refactor in whatwg#11987 that makes this more nonsensical.
zcorpan pushed a commit that referenced this pull request Jan 12, 2026
This fix was wrong and introduced a regression, as committing a same-document non-intercepted navigation should still call `navigatesuccess` etc.

Closes #12077.
annevk pushed a commit that referenced this pull request Jan 14, 2026
This fixes a bug introduced by #11952, where accidentally removing an "Otherwise" results in calling "clean up" also for same-document navigations, and a subsequent refactor in #11987 that makes this harder to trace.

Closes #12079.
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.

2 participants