LibWeb: Traverse shadow boundaries when looking for focus candidates
This makes focusing input fields by clicking on them work. Fixes #17801
This commit is contained in:
parent
72d817d4ea
commit
76e520884e
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/76e520884e
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue