summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Page
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-03-18 20:26:56 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-18 20:28:15 +0100
commit76e520884e9c846e3914c0d74741c032e32cb09f (patch)
tree177010cda9277c9f07b2b13a683a07f077a28b87 /Userland/Libraries/LibWeb/Page
parent72d817d4ea2476252160ac52936a2871a2c25ae1 (diff)
downloadserenity-76e520884e9c846e3914c0d74741c032e32cb09f.zip
LibWeb: Traverse shadow boundaries when looking for focus candidates
This makes focusing input fields by clicking on them work. Fixes #17801
Diffstat (limited to 'Userland/Libraries/LibWeb/Page')
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
index dc2f2999eb..5bee76c90d 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
@@ -385,7 +385,7 @@ bool EventHandler::handle_mousedown(CSSPixelPoint position, unsigned button, uns
if (paintable->dom_node()) {
// See if we want to focus something.
bool did_focus_something = false;
- for (auto candidate = node; candidate; candidate = candidate->parent()) {
+ for (auto candidate = node; candidate; candidate = candidate->parent_or_shadow_host()) {
if (candidate->is_focusable()) {
// When a user activates a click focusable focusable area, the user agent must run the focusing steps on the focusable area with focus trigger set to "click".
// Spec Note: Note that focusing is not an activation behavior, i.e. calling the click() method on an element or dispatching a synthetic click event on it won't cause the element to get focused.