[whatwg] Making elements match the :active pseudoclass

fantasai fantasai.lists at inkedblade.net
Tue Dec 28 14:06:22 PST 2010

On 12/28/2010 04:27 PM, Tab Atkins Jr. wrote:
> Currently,<http://www.whatwg.org/specs/web-apps/current-work/complete/links.html#pseudo-classes>
> states that the only elements which can receive the :active
> pseudoclass are a handful of form elements and any other element which
> is "specially focusable".
> This does not match any current browser.  All 5 of the major browsers
> allow any element to be :active when clicked.  They do differ slightly
> on how they determine when an element is :active, though:
> * Firefox and Webkit make the target of clicks and all its ancestors :active.

I'll note CSS specs explicitly allow making the ancestors of the
activated element to also match :active.

> * IE8 and IE9 make only the target of the click :active


does not turn green? That seems pretty broken.

> * I'm not 100% sure about Opera's behavior, but it appears that it
> finds the first ancestor of the target which would match an :active
> rule, and makes that element :active.

That's... interesting.

FWIW, I think the behavior currently in the spec makes the most sense.
If the element has no behavior to activate, it doesn't make sense to
me for the element to ever match :active. And if there is behavior to
activate, it should be keyboard-activateable as well, not just mouse-

I'm also interested to know whether there's a web-compat issue here or
just a bug-compat issue, and what the implementers think.


More information about the whatwg mailing list