The working draft spec states that browsers manufacturers are free to choose their own criteria for matching :focus-visible
as opposed to just regular old :focus
, but the spec does recommend several suggestions to be used as a starting point, including this:
Any element which supports keyboard input (such as an input element...) should always match :focus-visible
when focused.
To me, this says that ALL input elements should always match :focus-visible
.
In the example that you referenced, you'll notice that the button behavior is as expected. If you click the button with a mouse, it does not match :focus-visible
, but if you select it with keyboard navigation, then it does.