summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Page/EventHandler.cpp
diff options
context:
space:
mode:
authorPaul Irwin <paulirwin@gmail.com>2021-06-18 16:42:34 -0600
committerAndreas Kling <kling@serenityos.org>2021-06-25 01:02:29 +0200
commit5eb65286b63d5d2698af8b289c2b7372f49e53c6 (patch)
treedd9bf0f87715985f2ea7e807c548415695d060e4 /Userland/Libraries/LibWeb/Page/EventHandler.cpp
parent457edaa4d28c6d26a8f6091642129c5980ec6824 (diff)
downloadserenity-5eb65286b63d5d2698af8b289c2b7372f49e53c6.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/Page/EventHandler.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
index 14d14d596d..1fca7e74bd 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
@@ -237,6 +237,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
auto anchor = href.substring_view(1, href.length() - 1);
m_frame.scroll_to_anchor(anchor);
} else {
+ document->set_active_element(link);
if (m_frame.is_top_level()) {
if (auto* page = m_frame.page())
page->client().page_did_click_link(url, link->target(), modifiers);