LibWeb: Hide unrelated popovers when showing popovers

Also hides decendant popovers when hiding.
Also hides unrelated popovers when showing dialogs.
This commit is contained in:
Gingeh 2025-02-04 10:23:09 +11:00 committed by Tim Ledbetter
commit 91e4fb248b
Notes: github-actions[bot] 2025-02-16 19:41:05 +00:00
15 changed files with 607 additions and 56 deletions

View file

@ -712,6 +712,13 @@ public:
OrderedHashTable<GC::Ref<Element>> const& top_layer_elements() const { return m_top_layer_elements; }
// AD-HOC: These lists are managed dynamically instead of being generated as needed.
// Spec issue: https://github.com/whatwg/html/issues/11007
Vector<GC::Ref<HTML::HTMLElement>>& showing_auto_popover_list() { return m_showing_auto_popover_list; }
Vector<GC::Ref<HTML::HTMLElement>>& showing_hint_popover_list() { return m_showing_hint_popover_list; }
Vector<GC::Ref<HTML::HTMLElement>> const& showing_auto_popover_list() const { return m_showing_auto_popover_list; }
Vector<GC::Ref<HTML::HTMLElement>> const& showing_hint_popover_list() const { return m_showing_hint_popover_list; }
size_t transition_generation() const { return m_transition_generation; }
// Does document represent an embedded svg img
@ -1101,6 +1108,9 @@ private:
OrderedHashTable<GC::Ref<Element>> m_top_layer_elements;
OrderedHashTable<GC::Ref<Element>> m_top_layer_pending_removals;
Vector<GC::Ref<HTML::HTMLElement>> m_showing_auto_popover_list;
Vector<GC::Ref<HTML::HTMLElement>> m_showing_hint_popover_list;
// https://dom.spec.whatwg.org/#document-allow-declarative-shadow-roots
bool m_allow_declarative_shadow_roots { false };