LibWeb: Light dismiss dialogs on click

This commit is contained in:
Gingeh
2025-04-29 09:44:49 +10:00
committed by Andrew Kaster
parent 1f1884da54
commit aa9f556500
Notes: github-actions[bot] 2025-04-29 01:43:02 +00:00
9 changed files with 217 additions and 7 deletions

View File

@@ -97,6 +97,7 @@
#include <LibWeb/HTML/HTMLAreaElement.h>
#include <LibWeb/HTML/HTMLBaseElement.h>
#include <LibWeb/HTML/HTMLBodyElement.h>
#include <LibWeb/HTML/HTMLDialogElement.h>
#include <LibWeb/HTML/HTMLDocument.h>
#include <LibWeb/HTML/HTMLEmbedElement.h>
#include <LibWeb/HTML/HTMLFormElement.h>
@@ -593,6 +594,8 @@ void Document::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_showing_auto_popover_list);
visitor.visit(m_showing_hint_popover_list);
visitor.visit(m_popover_pointerdown_target);
visitor.visit(m_open_dialogs_list);
visitor.visit(m_dialog_pointerdown_target);
visitor.visit(m_console_client);
visitor.visit(m_editing_host_manager);
visitor.visit(m_local_storage_holder);

View File

@@ -801,6 +801,11 @@ public:
void set_popover_pointerdown_target(GC::Ptr<HTML::HTMLElement> target) { m_popover_pointerdown_target = target; }
GC::Ptr<HTML::HTMLElement> popover_pointerdown_target() { return m_popover_pointerdown_target; }
Vector<GC::Ref<HTML::HTMLDialogElement>>& open_dialogs_list() { return m_open_dialogs_list; }
void set_dialog_pointerdown_target(GC::Ptr<HTML::HTMLDialogElement> target) { m_dialog_pointerdown_target = target; }
GC::Ptr<HTML::HTMLDialogElement> dialog_pointerdown_target() { return m_dialog_pointerdown_target; }
size_t transition_generation() const { return m_transition_generation; }
// Does document represent an embedded svg img
@@ -1209,6 +1214,10 @@ private:
Vector<GC::Ref<HTML::HTMLElement>> m_showing_hint_popover_list;
GC::Ptr<HTML::HTMLElement> m_popover_pointerdown_target;
Vector<GC::Ref<HTML::HTMLDialogElement>> m_open_dialogs_list;
GC::Ptr<HTML::HTMLDialogElement> m_dialog_pointerdown_target;
// https://dom.spec.whatwg.org/#document-allow-declarative-shadow-roots
bool m_allow_declarative_shadow_roots { false };