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
commit 2323c77718
Notes: sideshowbarker 2024-07-17 17:49:11 +09:00

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