1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 22:42:08 +00:00

LibWeb: Remove ongoing navigation id check in navigate_to_a_fragment()

It is a mistake to add this early return in fragment navigation because
"ongoing navigation id" is not used during this kind of navigation.

With this change we no longer crash in Acid2 test after reload button
is pressed.
This commit is contained in:
Aliaksandr Kalenik 2023-11-18 14:32:31 +01:00 committed by Andreas Kling
parent aa73a7c961
commit 4f2a0a3d56

View file

@ -1313,10 +1313,8 @@ WebIDL::ExceptionOr<void> Navigable::navigate(NavigateParams params)
return {};
}
WebIDL::ExceptionOr<void> Navigable::navigate_to_a_fragment(AK::URL const& url, HistoryHandlingBehavior history_handling, String navigation_id)
WebIDL::ExceptionOr<void> Navigable::navigate_to_a_fragment(AK::URL const& url, HistoryHandlingBehavior history_handling, String)
{
(void)navigation_id;
// FIXME: 1. Let navigation be navigable's active window's navigation API.
// FIXME: 2. Let destinationNavigationAPIState be navigable's active session history entry's navigation API state.
// FIXME: 3. If navigationAPIState is not null, then set destinationNavigationAPIState to navigationAPIState.
@ -1374,12 +1372,7 @@ WebIDL::ExceptionOr<void> Navigable::navigate_to_a_fragment(AK::URL const& url,
auto traversable = traversable_navigable();
// 17. Append the following session history synchronous navigation steps involving navigable to traversable:
traversable->append_session_history_traversal_steps([this, traversable, history_entry, entry_to_replace, navigation_id] {
if (this->ongoing_navigation() != navigation_id) {
// NOTE: This check is not in the spec but we should not continue navigation if ongoing navigation id has changed.
return;
}
traversable->append_session_history_traversal_steps([this, traversable, history_entry, entry_to_replace] {
// 1. Finalize a same-document navigation given traversable, navigable, historyEntry, and entryToReplace.
finalize_a_same_document_navigation(*traversable, *this, history_entry, entry_to_replace);