1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibWeb: Call page_did_create_main_document() from navigables navigation

Before, this function were called from FrameLoader and now we still
have to call it from navigables navigation code so JS Console is
created.
This commit is contained in:
Aliaksandr Kalenik 2023-08-28 16:52:07 +02:00 committed by Andreas Kling
parent aef4b84e22
commit 2323c77718

View file

@ -182,11 +182,9 @@ void Navigable::activate_history_entry(JS::GCPtr<SessionHistoryEntry> entry)
new_document->make_active();
// Not in the spec:
if (is<TraversableNavigable>(*this) && parent() == nullptr) {
if (auto* page = active_browsing_context()->page()) {
page->client().page_did_start_loading(entry->url, false);
}
}
VERIFY(active_browsing_context());
VERIFY(active_browsing_context()->page());
active_browsing_context()->page()->client().page_did_create_new_document(*new_document);
}
// https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document