[Webkit-unassigned] [Bug 236782] [macOS][selectors] :focus-visible matching on button focused via script (after clicking on a different button)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 17 13:23:48 PST 2022
https://bugs.webkit.org/show_bug.cgi?id=236782
--- Comment #1 from Manuel Rego Casasnovas <rego at igalia.com> ---
So this is kind of tricky, there's a test that is testing this behavior explicitly:
https://wpt.fyi/results/css/selectors/focus-visible-script-focus-006.tentative.html
Test title is "CSS Test (Selectors): Script focus after mouse click on a NOT focusable element does match :focus-visible".
The test is marked as tentative, as it reflects current browser behavior, but might be not the intended behavior from the users POV.
There's not a clear spec text about all this, the text in https://drafts.csswg.org/selectors/#the-focus-visible-pseudo is just an example:
> If the previously-focused element indicated focus, and a script causes focus to move elsewhere, the newly focused element should indicate focus.
Like the previous element, the button in Mac, hasn't been actually focused (even when we clicked it), then the browser indicates focus in the next element.
There was an attempt to have a spec text about when to draw the focus indicator, but at the end it was discarded: https://github.com/whatwg/html/pull/6523
So I don't know what should we do regarding this issue. As usual the root issue is that buttons on Safari are not mouse focusable (see bug #229895), otherwise this would be working as expected.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220217/b4482350/attachment.htm>
More information about the webkit-unassigned
mailing list