mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Bail on applying the history step when no active window
This is an ad-hoc hack papering over the fact that we can apparently end up in these places without an active window, and proceeding without one leads to assertions on WPT.
This commit is contained in:
parent
59c8e0cd5a
commit
7ea7352bf3
Notes:
github-actions[bot]
2024-11-23 13:44:08 +00:00
Author: https://github.com/awesomekling
Commit: 7ea7352bf3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2519
1 changed files with 6 additions and 4 deletions
|
@ -815,15 +815,17 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
|
|||
|
||||
// 18. For each navigable of nonchangingNavigablesThatStillNeedUpdates, queue a global task on the navigation and traversal task source given navigable's active window to run the steps:
|
||||
for (auto& navigable : non_changing_navigables_that_still_need_updates) {
|
||||
if (navigable->has_been_destroyed()) {
|
||||
// AD-HOC: This check is not in the spec but we should not continue navigation if navigable has been destroyed,
|
||||
// or if there's no active window.
|
||||
if (navigable->has_been_destroyed() || !navigable->active_window()) {
|
||||
++completed_non_changing_jobs;
|
||||
continue;
|
||||
}
|
||||
|
||||
VERIFY(navigable->active_window());
|
||||
queue_global_task(Task::Source::NavigationAndTraversal, *navigable->active_window(), GC::create_function(heap(), [&] {
|
||||
// NOTE: This check is not in the spec but we should not continue navigation if navigable has been destroyed.
|
||||
if (navigable->has_been_destroyed()) {
|
||||
// AD-HOC: This check is not in the spec but we should not continue navigation if navigable has been destroyed,
|
||||
// or if there's no active window.
|
||||
if (navigable->has_been_destroyed() || !navigable->active_window()) {
|
||||
++completed_non_changing_jobs;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue