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

LibWeb+WebContent: Set ConsoleClient for nested browsing contexts

Before page_did_create_main_document() only initialized ConsoleClient
for top-level browsing context which means that nested browsing context
could not print into the console.

With this change, ConsoleClient is initialized for documents created
for nested browsing context too. One ConsoleClient is shared between
all browsing contexts within the same page.
This commit is contained in:
Aliaksandr Kalenik 2023-09-07 12:11:37 +02:00 committed by Andrew Kaster
parent 490949c6a8
commit b4fe118dff
6 changed files with 10 additions and 10 deletions

View file

@ -325,7 +325,7 @@ void FrameLoader::resource_did_load()
browsing_context().set_active_document(document);
if (auto* page = browsing_context().page())
page->client().page_did_create_main_document();
page->client().page_did_create_new_document(*document);
if (!parse_document(*document, resource()->encoded_data())) {
load_error_page(url, "Failed to parse content.");

View file

@ -200,7 +200,7 @@ public:
virtual Gfx::IntRect page_did_request_minimize_window() { return {}; }
virtual Gfx::IntRect page_did_request_fullscreen_window() { return {}; }
virtual void page_did_start_loading(const AK::URL&, bool is_redirect) { (void)is_redirect; }
virtual void page_did_create_main_document() { }
virtual void page_did_create_new_document(Web::DOM::Document&) { }
virtual void page_did_finish_loading(const AK::URL&) { }
virtual void page_did_change_selection() { }
virtual void page_did_request_cursor_change(Gfx::StandardCursor) { }