The case
- we have an
<a>
element with:active
state specified in CSS - in JavaScript code we listen to
mousedown
event and callevent.preventDefault()
for some reasons :) - As a result: in Firefox when I move mouse cursor over the anchor and click it -- anchor is not displayed as
:active
- I have also tested this issue in some Chrome / Opera / IE versions -- all that browsers had decorated the anchor as if it was
:active
.
Here is a test for the case: http://jsbin.com/azajex/4
The question
On W3C there is not deep description, what must be considered active
and when.
But all browsers (maybe, not all?) except FF handle mousedown firstly by CSS engine and render the element as :active
. It appears to be a long time issue, I tested this case in FF 3.6, 8.0, 13.0 -- all that versions behave exactly the same.
So, what is the right behaviour of a browser in this case?