Re: [csswg-drafts] CSS :active and JS mousedown preventDefault complication

> Test case http://jsfiddle.net/n45k9/112/ (seems to be specific for links indeed)

That testcase removes the actual target of the event (the textnode) from the DOM onmousedown, so the mousedown and mouseup are happening on different nodes.  You're right that Firefox doesn't fire click in that case (for the same reasons that click doesn't get fired if you mouse down on an element then move your mouse outside it before releasing), but that has nothing to do with preventDefault() in any way.  That testcase shows the same behavior if the preventDefault() is taken out.

> Well, it is.

Ugh.  Gecko basically just implements the "If the element is being actively pointed at" bit, and has all along, instead of doing this bizarre per-tag list of different behaviors.

> I guess the reason is the past only links used to be :active things

Fwiw, Gecko's current behavior has been in place ever since I recall.  I'd bet it's the only :active behavior Gecko ever had.  And it's allowed non-links to be :active all along.

In any case, as simple testcase for non-links at <http://jsbin.com/sawafonogu/edit?html,output> shows that browsers don't even agree on that.  And this one should only involve the "actively pointed at" concept.  Of course this concept is not defined in terms of events at all, which makes it vague enough that who knows what it means.

-- 
GitHub Notification of comment by bzbarsky
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2262#issuecomment-362881972 using your GitHub account

Received on Sunday, 4 February 2018 05:20:03 UTC