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.
This commit is contained in:
Aliaksandr Kalenik 2023-09-23 23:08:32 +02:00 committed by Andrew Kaster
parent 7cdbd59e92
commit f9520af71e

View file

@ -9,6 +9,7 @@
#include <LibWeb/HTML/History.h>
#include <LibWeb/HTML/StructuredSerialize.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/Page/Page.h>
namespace Web::HTML {
@ -189,6 +190,12 @@ WebIDL::ExceptionOr<void> 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);