Re: 2.4.7 Focus Visible

On 11/07/2023 15:55, Michael Livesey wrote:
> I think Patrick you have just demonstrated why the wording in 2.4.7 
> needs to change.

But the wording for 2.4.7 won't change, I'm afraid, unless we're doing a 
WCAG 2.3 and make a normative change here.

> However, that is NOT what 2.4.7 specifies. 2.4.7 specifies that ONLY 
> keyboard control should show a visible focus.

The fact that it only requires it for keyboard does not mean it makes it 
a failure/non-compliant for user agents to ALSO show it for other modes 
of operation.

> As a result of the wording 
> of 2.4.7, I already know of developers adding event listeners to catch 
> global events which prevent the focus visibility on everything except 
> keyboard events and claiming AA WCAG standards.
And they are right, because the wording only states that there is a 
*mode of operation* where keyboard focus is visible, and it only 
*requires* it normatively for at least one mode of operation. And the 
understanding document mentions the scenario explicitly in the intent 
https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html#intent

"“Mode of operation” accounts for user agents which may not always show 
a focus indicator, or only show the focus indicator when the keyboard is 
used. User agents may optimise when the focus indicator is shown, such 
as only showing it when a keyboard is used. Authors are responsible for 
providing at least one mode of operation where the focus is visible. In 
most cases there is only one mode of operation so this success criterion 
applies. The focus indicator must not be time limited, when the keyboard 
focus is shown it must remain."

> Therefore, if we you are arguing for 
> focus-visible as the gold standard, the wording of 2.4.7 should be 
> changed to "focus must be visible on all controls according to the 
> specification of focus-visible implemented by the browser or modified by 
> the user agent" which is actually the below 5 rules for most browsers 
> currently.

But WCAG is technology-agnostic, so that wording would be far too 
specific. And it would not be backwards compatible, as sites that were 
created before :focus-visible was even a thing would overnight become 
failing.

As a best practice, we can certainly suggest that authors should 
consider making focus also visible after a mouse/pointer interaction. As 
I said repeated, nobody's stopping you from proposing a new advisory 
technique. *BUT* we must be clear that use of just :focus-visible *DOES* 
pass the normative requirement as laid out in the SC.

P
-- 
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
https://mastodon.social/@patrick_h_lauke | skype: patrick_h_lauke

Received on Tuesday, 11 July 2023 15:07:41 UTC