This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Just like with TransitionEvent we should support pseudoElement on MouseEvent so when you click a ::before or ::after or ::backdrop the click event you get back tells you which pseudo element was clicked. See: http://www.w3.org/TR/css3-transitions/ This is important for <dialog> since it's quite common to want to dismiss the dialog when the user clicks the ::backdrop but right now you can't know that without getting the bounding client rects of the <dialog> and then looking to see if the hit was inside there.
Sounds like a bug in <dialog> design if it is expected that event handling explicitly needs to deal with pseudoElements all the time.
(In reply to comment #1) > Sounds like a bug in <dialog> design if it is expected that event handling > explicitly needs to deal with pseudoElements all the time. If it helps, this is just for modal <dialog> which has a ::backdrop for optionally graying out the screen underneath it. It makes sense to me that you can handle events on ::backdrop, so you can dismiss the dialog or make it bounce for attention. But maybe there is a better design.
It seems totally reasonable to want to know if someone clicked the element or the ::before or ::after. Right now if I position the ::before absolutely somewhere else on the page I can't easily tell (without triggering an unnecessary layout by calling getBoundingClientRects()) if the click was in the ::before or inside element itself.
This is a great suggestion. As it is a new feature request, I'm moving it to the node for future DOM 3 Events features: UI Events.
Now tracking as: https://github.com/w3c/uievents/issues/15