[csswg-drafts] [css-selectors-3] Make :active specification more explicit as to which interactions cause its triggering (#4787)

franktopel has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-selectors-3] Make :active specification more explicit as to which interactions cause its triggering ==
With regard to when to apply the `:active` pseudo class to an element, the [spec currently says this](https://drafts.csswg.org/selectors-3/#sel-active):

> The `:active` pseudo-class applies **while an element is being activated by the user**. _For example_, between the times the user presses the mouse button and releases it. On systems with more than one mouse button, :active applies only to the primary or primary activation button (typically the "left" mouse button), and any aliases thereof.

The spec should be more explicit here; the absence thereof has caused implementors to have implementations deviating from each other (which alone is unfortunate).

Even worse, neither Chromium nor Mozilla implement the general spec statement 

>The `:active` pseudo-class applies **while an element is being activated by the user**. 

with regard to using the `Enter` key to activate a `button`. Mozilla also does not apply `:active` when using the space bar to activate a `button`.

Both actions, pressing Space or Enter on a button, are clearly actions that result in *an element [...] being activated by the user*.

As soon as the spec is more explicit and clear here, I would like to file a bug with Chromium and Mozilla at least, haven't checked Webkit yet.

I've asked a question leading to me opening this issue on [StackOverflow](https://stackoverflow.com/questions/60281304/why-does-pressing-enter-on-a-button-not-cause-active-state-in-chrome).



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4787 using your GitHub account

Received on Tuesday, 18 February 2020 16:02:39 UTC