diff --git a/Ladybird/AppKit/UI/LadybirdWebView.mm b/Ladybird/AppKit/UI/LadybirdWebView.mm index b5da9bad77..c063892d12 100644 --- a/Ladybird/AppKit/UI/LadybirdWebView.mm +++ b/Ladybird/AppKit/UI/LadybirdWebView.mm @@ -282,7 +282,7 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_ [self.observer onLoadFinish:url]; }; - m_web_view_bridge->on_url_updated = [self](auto const& url, auto history_behavior) { + m_web_view_bridge->on_history_api_push_or_replace = [self](auto const& url, auto history_behavior) { [self.observer onURLUpdated:url historyBehavior:history_behavior]; }; diff --git a/Ladybird/Qt/Tab.cpp b/Ladybird/Qt/Tab.cpp index a020b14222..51a17ef148 100644 --- a/Ladybird/Qt/Tab.cpp +++ b/Ladybird/Qt/Tab.cpp @@ -150,7 +150,7 @@ Tab::Tab(BrowserWindow* window, WebContentOptions const& web_content_options, St m_inspector_widget->inspect(); }; - view().on_url_updated = [this](auto const& url, auto history_behavior) { + view().on_history_api_push_or_replace = [this](auto const& url, auto history_behavior) { switch (history_behavior) { case Web::HTML::HistoryHandlingBehavior::Push: m_history.push(url, m_title.toUtf8().data()); diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 9b111fe0a1..f5bfd63099 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -262,7 +262,7 @@ Tab::Tab(BrowserWindow& window) m_dom_inspector_widget->inspect(); }; - view().on_url_updated = [this](auto const& url, auto history_behavior) { + view().on_history_api_push_or_replace = [this](auto const& url, auto history_behavior) { switch (history_behavior) { case Web::HTML::HistoryHandlingBehavior::Push: m_history.push(url, m_title); diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index d3f7f0ee0e..95422dd9b1 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -215,7 +215,7 @@ WebIDL::ExceptionOr History::shared_history_push_replace_state(JS::Value d auto navigable = document->navigable(); if (navigable->is_top_level_traversable()) { - navigable->active_browsing_context()->page().client().page_did_update_url(new_url, history_handling); + 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 diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index b4cb618542..99d6497f3b 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -265,7 +265,7 @@ 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_update_url(URL::URL const&, Web::HTML::HistoryHandlingBehavior) { } + 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 0d85ed8dad..fe9bcedab3 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -145,7 +145,7 @@ public: Function on_title_change; Function on_load_start; Function on_load_finish; - Function on_url_updated; + 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 7f3d43f1ed..3c7c9ec8e5 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -66,13 +66,13 @@ void WebContentClient::did_finish_loading(u64 page_id, URL::URL const& url) } } -void WebContentClient::did_update_url(u64 page_id, URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) +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_url_updated) - view->on_url_updated(url, history_behavior); + if (view->on_history_api_push_or_replace) + view->on_history_api_push_or_replace(url, history_behavior); } } diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index 58ef673adc..803cd201d1 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -40,7 +40,7 @@ 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_update_url(u64 page_id, URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) 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 0b2ff33a5e..18e081de71 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -371,9 +371,9 @@ void PageClient::page_did_finish_loading(URL::URL const& url) client().async_did_finish_loading(m_id, url); } -void PageClient::page_did_update_url(URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) +void PageClient::page_did_history_api_push_or_replace(URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior) { - client().async_did_update_url(m_id, url, history_behavior); + client().async_did_history_api_push_or_replace(m_id, url, history_behavior); } void PageClient::page_did_finish_text_test() diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index d70a5d94d8..dae507375f 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -120,7 +120,7 @@ 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_update_url(URL::URL const&, Web::HTML::HistoryHandlingBehavior) 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 bd0f6c0c63..47947b7d42 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -23,7 +23,7 @@ endpoint WebContentClient did_start_loading(u64 page_id, URL::URL url, bool is_redirect) =| did_finish_loading(u64 page_id, URL::URL url) =| - did_update_url(u64 page_id, URL::URL url, Web::HTML::HistoryHandlingBehavior history_behavior) =| + 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) =|