Bug 239472

Summary: [selectors] Double script focus after mouse click shouldn't match :focus-visible
Product: WebKit Reporter: focusvisiblewebkitbugzilla
Component: CSSAssignee: Manuel Rego Casasnovas <rego>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, clopez, esprehn+autocc, ews-watchlist, kangil.han, koivisto, rego, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/33968
Bug Depends on:    
Bug Blocks: 185859    
Attachments:
Description Flags
Test case to reproduce the issue
none
Patch none

focusvisiblewebkitbugzilla
Reported 2022-04-18 16:32:36 PDT
Safari introduced :focus-visible support in 15.4. However, it behaves differently than Chrome and Firefox in that programmatically focusing elements will trigger :focus-visible styles. Many screens rely on programmatic focus for accessibility and are not expecting a focus ring to appear. Example: - Go to www.airbnb.com - On the top right, click the globe icon to bring up a "language and region" modal - Notice that the close button has a :focus-visible outline in Safari 15.4+ but not in Chrome or Firefox Another report: - https://githubhot.com/repo/reach/reach-ui/issues/915 Desired result: - :focus-visible in Safari should behave the same as Chrome and Firefox
Attachments
Test case to reproduce the issue (264 bytes, text/html)
2022-05-06 02:22 PDT, Manuel Rego Casasnovas
no flags
Patch (6.97 KB, patch)
2022-05-06 09:35 PDT, Manuel Rego Casasnovas
no flags
Radar WebKit Bug Importer
Comment 1 2022-04-25 16:33:12 PDT
Manuel Rego Casasnovas
Comment 2 2022-05-06 02:22:37 PDT
Created attachment 458942 [details] Test case to reproduce the issue
Manuel Rego Casasnovas
Comment 3 2022-05-06 09:27:09 PDT
The problem with that website is that it was focusing the element several times via script. The test case attached reproduce the issue. I'm working on a patch to fix it and behave consistently to Chromium and Firefox here.
Manuel Rego Casasnovas
Comment 4 2022-05-06 09:35:03 PDT
EWS Watchlist
Comment 5 2022-05-06 09:36:53 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
EWS
Comment 6 2022-05-06 15:08:06 PDT
Committed r293926 (250373@main): <https://commits.webkit.org/250373@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458956 [details].
Note You need to log in before you can comment on or make changes to this bug.