Bug 221925 - [selectors] Use :focus-visible in the default UA style sheet
Summary: [selectors] Use :focus-visible in the default UA style sheet
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WebExposed
Depends on: 185859
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-15 14:17 PST by Manuel Rego Casasnovas
Modified: 2021-03-03 00:33 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rego Casasnovas 2021-02-15 14:17:09 PST
Once :focus-visible is implemented we should change the default style sheet to use it instead of :-webkit-direct-focus.

Ideally it should keep the same behavior than :-webkit-direct-focus once the following CSSWG issue is resolved:
https://github.com/w3c/csswg-drafts/issues/5893#issuecomment-771230873
Otherwise we'll need to think about what we should do here.

Selectors and HTML specs indicate this:
* https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo
* https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3

Chromium and Firefox already do this.
Comment 1 Radar WebKit Bug Importer 2021-02-22 14:18:14 PST
<rdar://problem/74613552>
Comment 2 Manuel Rego Casasnovas 2021-03-03 00:33:36 PST
Once we do this, we'll probably want to add a similar optimization to the one we have for :focus in RuleSet and ElementRuleCollector.

This was part of a previous patch but wasn't merged yet as it was not needed from the functionality POV, see comments at https://bugs.webkit.org/show_bug.cgi?id=222028 for more details:
* https://bugs.webkit.org/show_bug.cgi?id=222028#c39
* https://bugs.webkit.org/show_bug.cgi?id=222028#c42
* https://bugs.webkit.org/show_bug.cgi?id=222028#c44