LibWeb: Implement dialog element's close watcher

Dialog elements now correctly establish a close watcher when
shown modally.

This means modal dialogs now correctly close with an escape key press.
This commit is contained in:
Luke Warlow 2024-06-22 23:09:51 +01:00 committed by Andreas Kling
parent 8969f2e34a
commit d86a6e1bec
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00
3 changed files with 52 additions and 11 deletions

View file

@ -34,6 +34,7 @@ private:
HTMLDialogElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
void close_the_dialog(Optional<String> result);
@ -41,6 +42,7 @@ private:
String m_return_value;
bool m_is_modal { false };
JS::GCPtr<CloseWatcher> m_close_watcher;
};
}