From aa31b69e7e70100451ae542664dc704e5861af12 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 17 Jul 2025 05:17:34 +0200 Subject: [PATCH] LibWeb+WebContent: Delete unused `page_did_layout()` --- Libraries/LibWeb/DOM/Document.cpp | 4 ---- Libraries/LibWeb/Page/Page.h | 1 - Services/WebContent/PageClient.cpp | 11 ----------- Services/WebContent/PageClient.h | 4 ---- 4 files changed, 20 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 5b2b9ea49f7..e516ee0c03d 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -1393,10 +1393,6 @@ void Document::update_layout(UpdateLayoutReason reason) update_paint_and_hit_testing_properties_if_needed(); paintable()->assign_clip_frames(); - if (navigable->is_traversable()) { - page().client().page_did_layout(); - } - if (auto range = get_selection()->range()) { paintable()->recompute_selection_states(*range); } diff --git a/Libraries/LibWeb/Page/Page.h b/Libraries/LibWeb/Page/Page.h index a45f10013a1..0829315c4ca 100644 --- a/Libraries/LibWeb/Page/Page.h +++ b/Libraries/LibWeb/Page/Page.h @@ -351,7 +351,6 @@ public: virtual void page_did_hover_link(URL::URL const&) { } virtual void page_did_unhover_link() { } virtual void page_did_change_favicon(Gfx::Bitmap const&) { } - virtual void page_did_layout() { } virtual void page_did_request_alert(String const&) { } virtual void page_did_request_confirm(String const&) { } virtual void page_did_request_prompt(String const&, String const&) { } diff --git a/Services/WebContent/PageClient.cpp b/Services/WebContent/PageClient.cpp index d6addec36c5..6b20ddf036c 100644 --- a/Services/WebContent/PageClient.cpp +++ b/Services/WebContent/PageClient.cpp @@ -207,17 +207,6 @@ void PageClient::page_did_request_cursor_change(Gfx::Cursor const& cursor) client().async_did_request_cursor_change(m_id, cursor); } -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(); -} - void PageClient::page_did_change_title(ByteString const& title) { client().async_did_change_title(m_id, title); diff --git a/Services/WebContent/PageClient.h b/Services/WebContent/PageClient.h index ce9c5bc0698..53ed0dc2eb5 100644 --- a/Services/WebContent/PageClient.h +++ b/Services/WebContent/PageClient.h @@ -63,8 +63,6 @@ public: void set_window_position(Web::DevicePixelPoint); void set_window_size(Web::DevicePixelSize); - Web::DevicePixelSize content_size() const { return m_content_size; } - Web::WebIDL::ExceptionOr toggle_media_play_state(); void toggle_media_mute_state(); Web::WebIDL::ExceptionOr toggle_media_loop_state(); @@ -112,7 +110,6 @@ private: virtual Web::CSS::PreferredContrast preferred_contrast() const override { return m_preferred_contrast; } virtual Web::CSS::PreferredMotion preferred_motion() const override { return m_preferred_motion; } virtual void page_did_request_cursor_change(Gfx::Cursor const&) override; - virtual void page_did_layout() override; virtual void page_did_change_title(ByteString const&) override; virtual void page_did_change_url(URL::URL const&) override; virtual void page_did_request_refresh() override; @@ -187,7 +184,6 @@ private: GC::Ref m_page; RefPtr m_palette_impl; Web::DevicePixelRect m_screen_rect; - Web::DevicePixelSize m_content_size; float m_device_pixels_per_css_pixel { 1.0f }; u64 m_id { 0 }; bool m_has_focus { false };