mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Use saved navigable pointer in destroy_the_child_navigable
During the destruction of a navigable, we need to use the pointer to the navigable that was saved at the beginning of the function. This is because `Node::navigable()` will return a nullptr in subsequent steps after the navigable's document becomes inactive.
This commit is contained in:
parent
cf985afdcb
commit
67f5c027fe
Notes:
sideshowbarker
2024-07-17 08:45:34 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/67f5c027fe Pull-request: https://github.com/SerenityOS/serenity/pull/18219
@ -253,7 +253,7 @@ void NavigableContainer::destroy_the_child_navigable()
|
||||
navigable->active_document()->destroy();
|
||||
|
||||
// 5. Let parentDocState be container's node navigable's active session history entry's document state.
|
||||
auto parent_doc_state = this->navigable()->active_session_history_entry()->document_state;
|
||||
auto parent_doc_state = navigable->active_session_history_entry()->document_state;
|
||||
|
||||
// 6. Remove the nested history from parentDocState's nested histories whose id equals navigable's id.
|
||||
parent_doc_state->nested_histories().remove_all_matching([&](auto& nested_history) {
|
||||
@ -261,7 +261,7 @@ void NavigableContainer::destroy_the_child_navigable()
|
||||
});
|
||||
|
||||
// 7. Let traversable be container's node navigable's traversable navigable.
|
||||
auto traversable = this->navigable()->traversable_navigable();
|
||||
auto traversable = navigable->traversable_navigable();
|
||||
|
||||
// Not in the spec
|
||||
navigable->set_has_been_destroyed();
|
||||
|
Loading…
Reference in New Issue
Block a user