We have a test focus-visible-010.html that checks that a programmatic focus on the load event, causes that the element getting focused matches :focus-visible. This test passes in the 2 implementations of :focus-visible (Chromium and Firefox).
However the spec doesn't mention anything about this in the suggestions list, and given that 2 browsers follow that, and we have a test, maybe it'd be nice to add that to the list too.
The spec mentions 2 cases of programmatic focus:
- If the active element matches :focus-visible, and a script causes focus to move elsewhere, the newly focused element should match :focus-visible.
- Conversely, if the active element does not match :focus-visible, and a script causes focus to move elsewhere, the newly focused element should not match :focus-visible.
But it doesn't mention what happens when there's no active element before the programmatic focus. WDYT?
CC @alice @emilio
We have a test
focus-visible-010.htmlthat checks that a programmatic focus on the load event, causes that the element getting focused matches:focus-visible. This test passes in the 2 implementations of:focus-visible(Chromium and Firefox).However the spec doesn't mention anything about this in the suggestions list, and given that 2 browsers follow that, and we have a test, maybe it'd be nice to add that to the list too.
The spec mentions 2 cases of programmatic focus:
But it doesn't mention what happens when there's no active element before the programmatic focus. WDYT?
CC @alice @emilio