mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
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.
This commit is contained in:
parent
5939af14d4
commit
01022eb5d6
11 changed files with 92 additions and 2 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue