[selectors] Use :focus-visible in the user agent style sheet
https://bugs.webkit.org/show_bug.cgi?id=221925
<rdar://problem/74613552>
Reviewed by Manuel Rego Casasnovas.
LayoutTests/imported/w3c:
- web-platform-tests/css/selectors/focus-visible-018-2-expected.txt:
- web-platform-tests/css/selectors/focus-visible-018-expected.txt:
Source/WebCore:
Replace :-internal-direct-focus with :focus-visible for the default focus outline styling in the user agent style sheet.
When enabled, this will change focus drawing behavior in two cases:
- <div tabindex> (or any element with 'tabindex' attribute that is not focusable otherwise) will not show focus
indicator when focused via click/tap/script.
- <details> will not show focus indicator when focused via click/tap/script.
Both still show focus indicator when focused via keyboard (tab) navigation.
With the feature disabled UA sheet :focus-visible behaves like :-internal-direct-focus.
This patch does not enable the feature yet.
- css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFocusVisiblePseudoClass):
Check the feature flag. If it is not enabled :focus-visible matches like :-internal-direct-focus.
(:focus-visible):
(:-internal-direct-focus): Deleted.
Replace :-internal-direct-focus.
- css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
Always allow :focus-visible when parsing UA sheet.
|