Skip to content

Commit 54d41cf

Browse files
AtkinsSJtcl3
authored andcommitted
LibWeb/HTML: Update navigation API when a same-document reload occurs
Corresponds to whatwg/html@3a2a05d
1 parent d54753e commit 54d41cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Libraries/LibWeb/HTML/Navigation.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,14 @@ bool Navigation::inner_navigate_event_firing_algorithm(
11261126
auto history_handling = navigation_type == Bindings::NavigationType::Push ? HistoryHandlingBehavior::Push : HistoryHandlingBehavior::Replace;
11271127
perform_url_and_history_update_steps(document, event->destination()->raw_url(), event->classic_history_api_state(), history_handling);
11281128
}
1129-
// Big spec note about reload here
1129+
1130+
// 8. Otherwise, if navigationType is "reload", then update the navigation API entries for a same-document navigation
1131+
// given navigation, navigable's active session history entry, and "reload".
1132+
// NOTE: If navigationType is "traverse", then this event firing is happening as part of the traversal process, and
1133+
// that process will take care of performing the appropriate session history entry updates.
1134+
if (navigation_type == Bindings::NavigationType::Reload) {
1135+
update_the_navigation_api_entries_for_a_same_document_navigation(*navigable->active_session_history_entry(), Bindings::NavigationType::Reload);
1136+
}
11301137
}
11311138

11321139
// 34. If endResultIsSameDocument is true:

0 commit comments

Comments
 (0)