mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibWeb+WebContent: Initialise JS console from Document::initialize()
Before this change JS console was initialise from activate_history_entry() which is too late for about:blank documents that are ready to run scripts immediately after creation.
This commit is contained in:
parent
939a8e9393
commit
649f70db65
Notes:
sideshowbarker
2024-07-17 07:08:37 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 649f70db65
Pull-request: https://github.com/SerenityOS/serenity/pull/23931
Issue: https://github.com/SerenityOS/serenity/issues/23892
5 changed files with 14 additions and 9 deletions
|
@ -378,6 +378,8 @@ void Document::initialize(JS::Realm& realm)
|
|||
m_selection = heap().allocate<Selection::Selection>(realm, realm, *this);
|
||||
|
||||
m_list_of_available_images = heap().allocate<HTML::ListOfAvailableImages>(realm);
|
||||
|
||||
page().client().page_did_create_new_document(*this);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#populate-with-html/head/body
|
||||
|
@ -3408,6 +3410,10 @@ void Document::make_active()
|
|||
// 2. Set document's browsing context's WindowProxy's [[Window]] internal slot value to window.
|
||||
m_browsing_context->window_proxy()->set_window(window);
|
||||
|
||||
if (m_browsing_context->is_top_level()) {
|
||||
page().client().page_did_change_active_document_in_top_level_browsing_context(*this);
|
||||
}
|
||||
|
||||
// 3. Set document's visibility state to document's node navigable's traversable navigable's system visibility state.
|
||||
if (navigable()) {
|
||||
m_visibility_state = navigable()->traversable_navigable()->system_visibility_state();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue