mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Implement window.stop()
Fixes a handful of timeouts on WPT.
This commit is contained in:
committed by
Andreas Kling
parent
fdee82d203
commit
3f461b96df
@@ -2234,4 +2234,18 @@ void Navigable::unregister_navigation_observer(Badge<NavigationObserver>, Naviga
|
||||
VERIFY(was_removed);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#nav-stop
|
||||
void Navigable::stop_loading()
|
||||
{
|
||||
// 1. Let document be navigable's active document.
|
||||
auto document = active_document();
|
||||
|
||||
// 2. If document's unload counter is 0, and navigable's ongoing navigation is a navigation ID, then set the ongoing navigation for navigable to null.
|
||||
if (document->unload_counter() == 0 && ongoing_navigation().has<String>())
|
||||
set_ongoing_navigation(Empty {});
|
||||
|
||||
// 3. Abort a document and its descendants given document.
|
||||
document->abort_a_document_and_its_descendants();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user