1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 12:15:09 +00:00

LibWeb: Update Location::reload() to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-08-22 18:21:00 +02:00 committed by Andreas Kling
parent dd7bba66ed
commit 083e4a3f30
3 changed files with 11 additions and 11 deletions

View file

@ -359,8 +359,17 @@ WebIDL::ExceptionOr<void> Location::set_hash(String const& value)
// https://html.spec.whatwg.org/multipage/history.html#dom-location-reload
void Location::reload() const
{
auto& window = verify_cast<HTML::Window>(HTML::current_global_object());
window.did_call_location_reload({});
// 1. Let document be this's relevant Document.
auto document = relevant_document();
// 2. If document is null, then return.
if (!document)
return;
// FIXME: 3. If document's origin is not same origin-domain with the entry settings object's origin, then throw a "SecurityError" DOMException.
// 4. Reload document's node navigable.
document->navigable()->reload();
}
// https://html.spec.whatwg.org/multipage/history.html#dom-location-replace