LibWeb: Implement dialog.requestClose()

This commit is contained in:
Luke Warlow 2025-01-16 20:37:18 +00:00 committed by Andrew Kaster
commit dd37d1c536
Notes: github-actions[bot] 2025-01-30 23:25:42 +00:00
8 changed files with 67 additions and 17 deletions

View file

@ -25,10 +25,15 @@ public:
static WebIDL::ExceptionOr<GC::Ref<CloseWatcher>> construct_impl(JS::Realm&, CloseWatcherOptions const& = {});
[[nodiscard]] static GC::Ref<CloseWatcher> establish(HTML::Window&);
bool request_close();
void request_close_for_bindings();
void close();
void destroy();
bool request_close(bool require_history_action_activation);
bool get_enabled_state() const { return m_is_enabled; }
void set_enabled(bool enabled) { m_is_enabled = enabled; }
virtual ~CloseWatcher() override = default;
void set_oncancel(WebIDL::CallbackType*);
@ -44,6 +49,7 @@ private:
bool m_is_running_cancel_action { false };
bool m_is_active { true };
bool m_is_enabled { true };
};
}