LibWeb: Implement reload for navigables

This commit is contained in:
Aliaksandr Kalenik 2023-04-07 00:08:39 +03:00 committed by Andreas Kling
commit ffd5b3da16
Notes: sideshowbarker 2024-07-16 18:26:46 +09:00
4 changed files with 28 additions and 0 deletions

View file

@ -951,4 +951,19 @@ WebIDL::ExceptionOr<void> Navigable::navigate_to_a_javascript_url(AK::URL const&
TODO();
}
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#reload
void Navigable::reload()
{
// 1. Set navigable's active session history entry's document state's reload pending to true.
active_session_history_entry()->document_state->set_reload_pending(true);
// 2. Let traversable be navigable's traversable navigable.
auto traversable = traversable_navigable();
// FIXME: 3. Append the following session history traversal steps to traversable:
// 1. Apply pending history changes to traversable with true.
traversable->apply_pending_history_changes();
}
}