1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:05:08 +00:00

LibWeb: Early return navigation process if navigable has been destroyed

If a navigable has been destroyed during a navigation process, we
should early return from it. The introduced checks are not in
the spec because, as explained in
https://github.com/whatwg/html/issues/9690 the spec is not written
with such a level of detail.
This commit is contained in:
Aliaksandr Kalenik 2023-09-05 23:36:20 +02:00 committed by Andreas Kling
parent c20123378d
commit c437f16cc1
4 changed files with 50 additions and 2 deletions

View file

@ -334,6 +334,10 @@ void NavigableContainer::destroy_the_child_navigable()
// 7. Let traversable be container's node navigable's traversable navigable.
auto traversable = this->navigable()->traversable_navigable();
// Not in the spec
navigable->set_has_been_destroyed();
HTML::all_navigables().remove(navigable);
// 8. Append the following session history traversal steps to traversable:
traversable->append_session_history_traversal_steps([traversable] {
// 1. Apply pending history changes to traversable.