Skip to content

:active and activating via the keyboard #7578

Open
@domenic

Description

@domenic

Spinning off from #6635 (comment) . Question: when does :active match? #7465 takes care of some of the current interop problems, but isn't merged yet due to lack of tests; let's use https://whatpr.org/html/7465/semantics-other.html#selector-active as the working definition for this issue.

https://jsbin.com/cifugag/1/edit?html,output shows that the spec does not match either Firefox or Chrome:

  • Spec: pressing spacebar on the <input type=radio> must not match :active, since it's not on the special list of elements for which "in a formal activation state" applies. Pressing spacebar on the <button> must match :active, since it is on that list.

  • Firefox: pressing spacebar never causes any elements to match :active. Only the "being actively pointed at" clause applies.

  • Chrome: pressing spacebar causes both the <input type=radio> and the <button> to match :active. It does not cause the <div> to match :active. Chrome appears to be applying the "in a formal activation state" definition to any element with activation behavior, which includes radio buttons but not divs.

  • Safari: ???

I personally think the Chrome behavior makes the most sense (as it gives keyboard users and mouse users the same experience). The next step is to test Safari to see if that can give us any input.

Metadata

Metadata

Assignees

Labels

interopImplementations are not interoperable with each othertopic: style

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions