mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
LibWeb: Implement the "check if unloading is canceled" AO
This method is responsible for firing `beforeunload` events.
This commit is contained in:
parent
f807b2800e
commit
1fa948f114
Notes:
github-actions[bot]
2024-10-05 07:18:28 +00:00
Author: https://github.com/tcl3
Commit: 1fa948f114
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1614
Reviewed-by: https://github.com/awesomekling
7 changed files with 231 additions and 8 deletions
|
@ -1369,10 +1369,11 @@ WebIDL::ExceptionOr<void> Navigable::navigate(NavigateParams params)
|
|||
return;
|
||||
}
|
||||
|
||||
// FIXME: 1. Let unloadPromptCanceled be the result of checking if unloading is user-canceled for navigable's active document's inclusive descendant navigables.
|
||||
// 1. Let unloadPromptCanceled be the result of checking if unloading is user-canceled for navigable's active document's inclusive descendant navigables.
|
||||
auto unload_prompt_canceled = traversable_navigable()->check_if_unloading_is_canceled(this->active_document()->inclusive_descendant_navigables());
|
||||
|
||||
// FIXME: 2. If unloadPromptCanceled is true, or navigable's ongoing navigation is no longer navigationId, then:
|
||||
if (!ongoing_navigation().has<String>() || ongoing_navigation().get<String>() != navigation_id) {
|
||||
// 2. If unloadPromptCanceled is true, or navigable's ongoing navigation is no longer navigationId, then:
|
||||
if (unload_prompt_canceled != TraversableNavigable::CheckIfUnloadingIsCanceledResult::Continue || !ongoing_navigation().has<String>() || ongoing_navigation().get<String>() != navigation_id) {
|
||||
// FIXME: 1. Invoke WebDriver BiDi navigation failed with targetBrowsingContext and a new WebDriver BiDi navigation status whose id is navigationId, status is "canceled", and url is url.
|
||||
|
||||
// 2. Abort these steps.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue