Questions about the :focus-visible heuristics

Heya Alice, fantasai and I were reviewing the :focus-visible
heuristics as part of edits making it clearer that these were
suggested heuristics for focus-ring drawing *in general*, and we're
slightly confused about the last two bullet points:

> * 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.

The intent of these two seem reasonably clear - if script moves focus,
the UA should indicate focus if-and-only-if it was previously
indicating focus - but we did some testing and as far as we can tell,
no current UA implements anything like this. All of them instead seem
to treat "focused by script" the same as "focused by a click",
regardless of what was previously focused.

What was the reasoning behind these heuristics? Should we keep them?
Currently we're inclined to drop them.

Related, it *seems* like the "Conversely, ..." bullet point is *just*
intended to modify the immediately preceding bullet point, not the
rest of the list. Is this right? I've just pushed some edits that
merge them into a single bullet point on the assumption that this is
correct.

~TJ

Received on Thursday, 18 February 2021 21:43:28 UTC