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
Keywords: BrowserCompat, InRadar, WebExposed
Depends on: 185859
  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:


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:
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
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