mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
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:
parent
7cdbd59e92
commit
f9520af71e
Notes:
sideshowbarker
2024-07-17 07:11:12 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/f9520af71e Pull-request: https://github.com/SerenityOS/serenity/pull/21209 Issue: https://github.com/SerenityOS/serenity/issues/21185 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue