mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +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
|
@ -97,6 +97,13 @@ public:
|
|||
|
||||
void paint(Web::DevicePixelRect const&, Painting::BackingStore&, Web::PaintOptions);
|
||||
|
||||
enum class CheckIfUnloadingIsCanceledResult {
|
||||
CanceledByBeforeUnload,
|
||||
CanceledByNavigate,
|
||||
Continue,
|
||||
};
|
||||
CheckIfUnloadingIsCanceledResult check_if_unloading_is_canceled(Vector<JS::Handle<Navigable>> navigables_that_need_before_unload);
|
||||
|
||||
private:
|
||||
TraversableNavigable(JS::NonnullGCPtr<Page>);
|
||||
|
||||
|
@ -112,6 +119,8 @@ private:
|
|||
Optional<Bindings::NavigationType> navigation_type,
|
||||
SynchronousNavigation);
|
||||
|
||||
CheckIfUnloadingIsCanceledResult check_if_unloading_is_canceled(Vector<JS::Handle<Navigable>> navigables_that_need_before_unload, JS::GCPtr<TraversableNavigable> traversable, Optional<int> target_step, Optional<UserNavigationInvolvement> user_involvement_for_navigate_events);
|
||||
|
||||
Vector<JS::NonnullGCPtr<SessionHistoryEntry>> get_session_history_entries_for_the_navigation_api(JS::NonnullGCPtr<Navigable>, int);
|
||||
|
||||
[[nodiscard]] bool can_go_forward() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue