diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index ff66ce367e4..147a3776f4b 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -288,7 +288,6 @@ public: 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_scroll_to(CSSPixelPoint) { } 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/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index aace478bd37..f5f0650408a 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -154,7 +154,6 @@ public: Function on_navigate_forward; Function on_refresh; Function on_favicon_change; - Function on_scroll_to_point; Function on_cursor_change; Function on_enter_tooltip_area; Function on_leave_tooltip_area; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index 1801e1b079c..39f2356579f 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -149,14 +149,6 @@ void WebContentClient::did_change_url(u64 page_id, URL::URL const& url) } } -void WebContentClient::did_request_scroll_to(u64 page_id, Gfx::IntPoint scroll_position) -{ - if (auto view = view_for_page_id(page_id); view.has_value()) { - if (view->on_scroll_to_point) - view->on_scroll_to_point(scroll_position); - } -} - void WebContentClient::did_enter_tooltip_area(u64 page_id, Gfx::IntPoint content_position, ByteString const& title) { if (auto view = view_for_page_id(page_id); view.has_value()) { diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index eff2e578633..44380cfa6a8 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -46,7 +46,6 @@ private: 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_scroll_to(u64 page_id, Gfx::IntPoint) override; virtual void did_enter_tooltip_area(u64 page_id, Gfx::IntPoint, ByteString const&) override; virtual void did_leave_tooltip_area(u64 page_id) override; virtual void did_hover_link(u64 page_id, URL::URL const&) override; diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index 20ee4753c3a..630e773eddd 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -309,19 +309,6 @@ Gfx::IntRect PageClient::page_did_request_fullscreen_window() return client().did_request_fullscreen_window(m_id); } -void PageClient::page_did_request_scroll_to(Web::CSSPixelPoint scroll_position) -{ - // NOTE: The viewport scroll position is updated preemptively, so that subsequent - // viewport offset calculation could use new offset even before actual - // scroll on browser side happens. - auto viewport = page().top_level_traversable()->viewport_rect(); - viewport.set_location(scroll_position); - page().top_level_traversable()->set_viewport_size(viewport.size()); - - auto device_scroll_position = page().css_to_device_point(scroll_position); - client().async_did_request_scroll_to(m_id, device_scroll_position.to_type()); -} - void PageClient::page_did_enter_tooltip_area(Web::CSSPixelPoint content_position, ByteString const& title) { auto device_position = page().css_to_device_point(content_position); diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index 269ab59a027..907787565bf 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -107,7 +107,6 @@ private: virtual Gfx::IntRect page_did_request_maximize_window() override; virtual Gfx::IntRect page_did_request_minimize_window() override; virtual Gfx::IntRect page_did_request_fullscreen_window() override; - virtual void page_did_request_scroll_to(Web::CSSPixelPoint) override; virtual void page_did_enter_tooltip_area(Web::CSSPixelPoint, ByteString const&) override; virtual void page_did_leave_tooltip_area() override; virtual void page_did_hover_link(URL::URL const&) override; diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc index 0d298858a0e..c8c9a4f47cd 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -29,7 +29,6 @@ endpoint WebContentClient 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_scroll_to(u64 page_id, Gfx::IntPoint scroll_position) =| did_enter_tooltip_area(u64 page_id, Gfx::IntPoint content_position, ByteString title) =| did_leave_tooltip_area(u64 page_id) =| did_hover_link(u64 page_id, URL::URL url) =|