1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +00:00

LibWeb: Support :active pseudo-class for hyperlinks, :focus possibly

Adds support for the :active pseudo-class for hyperlinks (<a> tags
only).

Also, since it was very similar to :focus and an element having a
focused state was already implemented, I went ahead and implemented
that pseudo-class too, although I cannot come up with a working
example to validate it.
This commit is contained in:
Paul Irwin 2021-06-18 16:42:34 -06:00 committed by Andreas Kling
parent 457edaa4d2
commit 5eb65286b6
10 changed files with 39 additions and 2 deletions

View file

@ -208,6 +208,10 @@ public:
void set_focused_element(Element*);
const Element* active_element() const { return m_active_element; }
void set_active_element(Element*);
bool created_for_appropriate_template_contents() const { return m_created_for_appropriate_template_contents; }
void set_created_for_appropriate_template_contents(bool value) { m_created_for_appropriate_template_contents = value; }
@ -323,6 +327,7 @@ private:
bool m_editable { false };
WeakPtr<Element> m_focused_element;
WeakPtr<Element> m_active_element;
bool m_created_for_appropriate_template_contents { false };
RefPtr<Document> m_associated_inert_template_document;