From 9c608b46fd08208ac2998f8597ca5012ad015f83 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 14 Apr 2024 17:01:19 -0400 Subject: [PATCH] LibWeb+LibWebView+WebContent: Remove now-unused history change IPC --- Userland/Libraries/LibWeb/HTML/History.cpp | 6 ------ Userland/Libraries/LibWeb/Page/Page.h | 2 -- Userland/Libraries/LibWebView/ViewImplementation.h | 1 - Userland/Libraries/LibWebView/WebContentClient.cpp | 10 ---------- Userland/Libraries/LibWebView/WebContentClient.h | 2 -- Userland/Services/WebContent/PageClient.cpp | 5 ----- Userland/Services/WebContent/PageClient.h | 1 - Userland/Services/WebContent/WebContentClient.ipc | 2 -- 8 files changed, 29 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 95422dd9b19..6858d8ba7c5 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -9,7 +9,6 @@ #include #include #include -#include namespace Web::HTML { @@ -213,11 +212,6 @@ WebIDL::ExceptionOr History::shared_history_push_replace_state(JS::Value d // and classicHistoryAPIState set to serializedData. // FIXME: 9. If continue is false, then return. - auto navigable = document->navigable(); - if (navigable->is_top_level_traversable()) { - navigable->active_browsing_context()->page().client().page_did_history_api_push_or_replace(new_url, history_handling); - } - // 10. Run the URL and history update steps given document and newURL, with serializedData set to // serializedData and historyHandling set to historyHandling. perform_url_and_history_update_steps(document, new_url, serialized_data, history_handling); diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index c8aef0399cf..7f60ab4ad24 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -266,7 +265,6 @@ public: virtual void page_did_change_active_document_in_top_level_browsing_context(Web::DOM::Document&) { } virtual void page_did_destroy_document(Web::DOM::Document&) { } virtual void page_did_finish_loading(URL::URL const&) { } - virtual void page_did_history_api_push_or_replace(URL::URL const&, Web::HTML::HistoryHandlingBehavior) { } virtual void page_did_request_cursor_change(Gfx::StandardCursor) { } virtual void page_did_request_context_menu(CSSPixelPoint) { } virtual void page_did_request_link_context_menu(CSSPixelPoint, URL::URL const&, [[maybe_unused]] ByteString const& target, [[maybe_unused]] unsigned modifiers) { } diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index dc5cc250773..202addee055 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -146,7 +146,6 @@ public: Function on_url_change; Function on_load_start; Function on_load_finish; - Function on_history_api_push_or_replace; Function on_request_file; Function on_navigate_back; Function on_navigate_forward; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index d0b40abea5b..3601d931dc0 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -66,16 +66,6 @@ void WebContentClient::did_finish_loading(u64 page_id, URL::URL const& url) } } -void WebContentClient::did_history_api_push_or_replace(u64 page_id, URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) -{ - if (auto view = view_for_page_id(page_id); view.has_value()) { - view->set_url({}, url); - - if (view->on_history_api_push_or_replace) - view->on_history_api_push_or_replace(url, history_behavior); - } -} - void WebContentClient::did_finish_text_test(u64 page_id) { 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 e5211abb06e..274d294268c 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -40,7 +39,6 @@ private: virtual void notify_process_information(WebView::ProcessHandle const&) override; virtual void did_paint(u64 page_id, Gfx::IntRect const&, i32) override; virtual void did_finish_loading(u64 page_id, URL::URL const&) override; - virtual void did_history_api_push_or_replace(u64 page_id, URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) override; virtual void did_request_navigate_back(u64 page_id) override; virtual void did_request_navigate_forward(u64 page_id) override; virtual void did_request_refresh(u64 page_id) override; diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index 113f9e22815..dba38dfcc92 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -376,11 +376,6 @@ void PageClient::page_did_finish_loading(URL::URL const& url) client().async_did_finish_loading(m_id, url); } -void PageClient::page_did_history_api_push_or_replace(URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) -{ - client().async_did_history_api_push_or_replace(m_id, url, history_behavior); -} - void PageClient::page_did_finish_text_test() { client().async_did_finish_text_test(m_id); diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index 9814baed2d1..015a709dafe 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -121,7 +121,6 @@ private: virtual void page_did_change_active_document_in_top_level_browsing_context(Web::DOM::Document&) override; virtual void page_did_destroy_document(Web::DOM::Document&) override; virtual void page_did_finish_loading(URL::URL const&) override; - virtual void page_did_history_api_push_or_replace(URL::URL const&, Web::HTML::HistoryHandlingBehavior) override; virtual void page_did_request_alert(String const&) override; virtual void page_did_request_confirm(String const&) override; virtual void page_did_request_prompt(String const&, String const&) override; diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc index dca734f1d22..2091772da8b 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -23,7 +22,6 @@ endpoint WebContentClient did_start_loading(u64 page_id, URL::URL url, bool is_redirect) =| did_finish_loading(u64 page_id, URL::URL url) =| - did_history_api_push_or_replace(u64 page_id, URL::URL url, Web::HTML::HistoryHandlingBehavior history_behavior) =| did_request_navigate_back(u64 page_id) =| did_request_navigate_forward(u64 page_id) =| did_request_refresh(u64 page_id) =|