From 41a812156cdaf530d3df2572ad4a29e3175d493e Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 7 Nov 2024 14:09:42 -0500 Subject: [PATCH] LibWeb+LibWebView+WebContent: Remove unused layout notification IPC --- Userland/Libraries/LibWebView/ViewImplementation.h | 1 - Userland/Libraries/LibWebView/WebContentClient.cpp | 8 -------- Userland/Libraries/LibWebView/WebContentClient.h | 1 - Userland/Services/WebContent/PageClient.cpp | 2 +- Userland/Services/WebContent/WebContentClient.ipc | 1 - 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index 364b7636c02..6c0481a6abc 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -159,7 +159,6 @@ public: void enable_inspector_prototype(); - Function on_did_layout; Function on_ready_to_paint; Function)> on_new_web_view; Function on_activate_tab; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index 76b8a0844df..5c9e4376ee1 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -119,14 +119,6 @@ void WebContentClient::did_request_cursor_change(u64 page_id, i32 cursor_type) } } -void WebContentClient::did_layout(u64 page_id, Gfx::IntSize content_size) -{ - if (auto view = view_for_page_id(page_id); view.has_value()) { - if (view->on_did_layout) - view->on_did_layout(content_size); - } -} - void WebContentClient::did_change_title(u64 page_id, ByteString const& title) { if (auto process = WebView::Application::the().find_process(m_process_handle.pid); process.has_value()) diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index 68d908f4bad..b03c38553c9 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -53,7 +53,6 @@ private: virtual void did_finish_loading(u64 page_id, URL::URL const&) override; virtual void did_request_refresh(u64 page_id) override; virtual void did_request_cursor_change(u64 page_id, i32) override; - virtual void did_layout(u64 page_id, Gfx::IntSize) override; virtual void did_change_title(u64 page_id, ByteString const&) override; virtual void did_change_url(u64 page_id, URL::URL const&) override; virtual void did_request_tooltip_override(u64 page_id, Gfx::IntPoint, ByteString const&) override; diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index 82339bd13bc..76782b6866e 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -229,11 +229,11 @@ void PageClient::page_did_layout() { auto* layout_root = this->layout_root(); VERIFY(layout_root); + if (layout_root->paintable_box()->has_scrollable_overflow()) m_content_size = page().enclosing_device_rect(layout_root->paintable_box()->scrollable_overflow_rect().value()).size(); else m_content_size = page().enclosing_device_rect(layout_root->paintable_box()->absolute_rect()).size(); - client().async_did_layout(m_id, m_content_size.to_type()); } void PageClient::page_did_change_title(ByteString const& title) diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc index 22032198cab..548b3b633ab 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -25,7 +25,6 @@ endpoint WebContentClient did_request_refresh(u64 page_id) =| did_paint(u64 page_id, Gfx::IntRect content_rect, i32 bitmap_id) =| did_request_cursor_change(u64 page_id, i32 cursor_type) =| - did_layout(u64 page_id, Gfx::IntSize content_size) =| did_change_title(u64 page_id, ByteString title) =| did_change_url(u64 page_id, URL::URL url) =| did_request_tooltip_override(u64 page_id, Gfx::IntPoint position, ByteString title) =|