mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 15:49:15 +00:00
LibWeb: Implement dialog.requestClose()
This commit is contained in:
parent
b056e27afd
commit
dd37d1c536
Notes:
github-actions[bot]
2025-01-30 23:25:42 +00:00
Author: https://github.com/lukewarlow
Commit: dd37d1c536
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3280
Reviewed-by: https://github.com/ADKaster ✅
8 changed files with 67 additions and 17 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibWeb/ARIA/Roles.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/HTML/ToggleTaskTracker.h>
|
||||
|
@ -28,6 +29,7 @@ public:
|
|||
WebIDL::ExceptionOr<void> show();
|
||||
WebIDL::ExceptionOr<void> show_modal();
|
||||
void close(Optional<String> return_value);
|
||||
void request_close(Optional<String> return_value);
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-dialog
|
||||
virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::dialog; }
|
||||
|
@ -50,6 +52,7 @@ private:
|
|||
|
||||
String m_return_value;
|
||||
bool m_is_modal { false };
|
||||
Optional<String> m_request_close_return_value;
|
||||
GC::Ptr<CloseWatcher> m_close_watcher;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dialog-toggle-task-tracker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue