LibWeb: Implement window.stop()

Fixes a handful of timeouts on WPT.
This commit is contained in:
Andreas Kling 2024-12-05 10:56:47 +01:00 committed by Andreas Kling
parent fdee82d203
commit 3f461b96df
Notes: github-actions[bot] 2024-12-05 11:39:56 +00:00
11 changed files with 94 additions and 0 deletions

View file

@ -856,6 +856,18 @@ GC::Ref<History> Window::history() const
return associated_document().history();
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-stop
void Window::stop()
{
// 1. If this's navigable is null, then return.
auto navigable = this->navigable();
if (!navigable)
return;
// 2. Stop loading this's navigable.
navigable->stop_loading();
}
// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
void Window::focus()
{