mirror of
https://github.com/RGBCube/serenity
synced 2025-07-22 22:27:39 +00:00
LibWeb: Exit navigation process if navigation id has changed
Change of navigation id means that it has been aborted, and we should return early.
This commit is contained in:
parent
b7c93cae7f
commit
7ad2dd2693
1 changed files with 10 additions and 1 deletions
|
@ -1052,6 +1052,10 @@ WebIDL::ExceptionOr<void> Navigable::navigate(
|
||||||
// NOTE: This check is not in the spec but we should not continue navigation if navigable has been destroyed.
|
// NOTE: This check is not in the spec but we should not continue navigation if navigable has been destroyed.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
finalize_a_cross_document_navigation(*this, to_history_handling_behavior(history_handling), history_entry);
|
finalize_a_cross_document_navigation(*this, to_history_handling_behavior(history_handling), history_entry);
|
||||||
});
|
});
|
||||||
}).release_value_but_fixme_should_propagate_errors();
|
}).release_value_but_fixme_should_propagate_errors();
|
||||||
|
@ -1113,7 +1117,12 @@ WebIDL::ExceptionOr<void> Navigable::navigate_to_a_fragment(AK::URL const& url,
|
||||||
auto traversable = traversable_navigable();
|
auto traversable = traversable_navigable();
|
||||||
|
|
||||||
// 17. Append the following session history synchronous navigation steps involving navigable to traversable:
|
// 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] {
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. Finalize a same-document navigation given traversable, navigable, historyEntry, and entryToReplace.
|
// 1. Finalize a same-document navigation given traversable, navigable, historyEntry, and entryToReplace.
|
||||||
finalize_a_same_document_navigation(*traversable, *this, history_entry, entry_to_replace);
|
finalize_a_same_document_navigation(*traversable, *this, history_entry, entry_to_replace);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue