From 02186e2ee9f128f85df9e54ce4aa0ebc3310e05a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 6 Nov 2022 21:45:30 +0100 Subject: [PATCH] LibWeb: Skip anonymous layout nodes while finding the event target This makes the links on nitter.net clickable, e.g. "preferences" in the upper right corner. --- Userland/Libraries/LibWeb/Page/EventHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index c807a76c83..cfad8df628 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -39,6 +39,8 @@ static bool parent_element_for_event_dispatch(Painting::Paintable const& paintab layout_node = &paintable.layout_node(); while (layout_node && node && !node->is_element() && layout_node->parent()) { layout_node = layout_node->parent(); + if (layout_node->is_anonymous()) + continue; node = layout_node->dom_node(); } return node && layout_node;