summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/Document.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-14 19:40:37 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-15 00:05:45 +0200
commit01022eb5d69753d55edcbd538ae8a5a3aabf199c (patch)
tree1b1a87d5f4f8533b2e5ddfbc6c6a6c3672167512 /Libraries/LibWeb/DOM/Document.h
parent5939af14d4b8bf8763e094bb6805765319288466 (diff)
downloadserenity-01022eb5d69753d55edcbd538ae8a5a3aabf199c.zip
LibWeb: Allow focusing individual (focusable) elements with Tab key
You can now cycle through focusable elements (currently only hyperlinks are focusable) with the Tab key. The focus outline is rendered in a new FocusOutline paint phase.
Diffstat (limited to 'Libraries/LibWeb/DOM/Document.h')
-rw-r--r--Libraries/LibWeb/DOM/Document.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h
index 5e1737c692..fc6910c490 100644
--- a/Libraries/LibWeb/DOM/Document.h
+++ b/Libraries/LibWeb/DOM/Document.h
@@ -161,6 +161,11 @@ public:
void set_editable(bool editable) { m_editable = editable; }
virtual bool is_editable() const final;
+ Element* focused_element() { return m_focused_element; }
+ const Element* focused_element() const { return m_focused_element; }
+
+ void set_focused_element(Element*);
+
private:
virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override;
@@ -191,6 +196,8 @@ private:
QuirksMode m_quirks_mode { QuirksMode::No };
bool m_editable { false };
+
+ WeakPtr<Element> m_focused_element;
};
}