From f9520af71ead39f02995fbb51852601eaa5c6a48 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 23 Sep 2023 23:08:32 +0200 Subject: [PATCH] LibWeb: Do page_did_start_loading if history state is pushed/replaced page_did_start_loading need to be called when current history entry changes to update URL in UI. --- Userland/Libraries/LibWeb/HTML/History.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index ed38535464..1e12a803d9 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace Web::HTML { @@ -189,6 +190,12 @@ WebIDL::ExceptionOr History::shared_history_push_replace_state(JS::Value v // and classicHistoryAPIState set to serializedData. // FIXME: 9. If continue is false, then return. + auto navigable = document->navigable(); + if (navigable->is_top_level_traversable()) { + if (auto* page = navigable->active_browsing_context()->page()) + page->client().page_did_start_loading(new_url, false); + } + // 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, history_handling);