LibWeb: Remember last focus trigger in Document

We will need this to implement focus indication.
This commit is contained in:
Jelle Raaijmakers 2025-06-13 14:10:30 +02:00 committed by Alexander Kalenik
commit 7016921067
Notes: github-actions[bot] 2025-06-13 15:40:30 +00:00
5 changed files with 20 additions and 4 deletions

View file

@ -30,6 +30,7 @@
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/CrossOrigin/OpenerPolicy.h>
#include <LibWeb/HTML/DocumentReadyState.h>
#include <LibWeb/HTML/Focus.h>
#include <LibWeb/HTML/HTMLScriptElement.h>
#include <LibWeb/HTML/History.h>
#include <LibWeb/HTML/LazyLoadingElement.h>
@ -433,6 +434,9 @@ public:
void set_focused_element(GC::Ptr<Element>);
HTML::FocusTrigger last_focus_trigger() const { return m_last_focus_trigger; }
void set_last_focus_trigger(HTML::FocusTrigger trigger) { m_last_focus_trigger = trigger; }
Element const* active_element() const { return m_active_element.ptr(); }
void set_active_element(GC::Ptr<Element>);
@ -1013,6 +1017,8 @@ private:
bool m_editable { false };
GC::Ptr<Element> m_focused_element;
HTML::FocusTrigger m_last_focus_trigger { HTML::FocusTrigger::Other };
GC::Ptr<Element> m_active_element;
GC::Ptr<Element> m_target_element;