[uievents] MouseEvent should have DOMString pseudoElement property like TransitionEvent (#15)

Copied from W3C Bugzilla: https://www.w3.org/Bugs/Public/show_bug.cgi?id=22569

##### Elliott Sprehn 2013-07-03 23:53:52 UTC
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.

##### Comment 1 Olli Pettay 2013-07-04 09:02:57 UTC
Sounds like a bug in <dialog> design if it is expected that event handling
explicitly needs to deal with pseudoElements all the time.

##### Comment 2 Matt Falkenhagen 2013-07-04 12:29:31 UTC
(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.

##### Comment 3 Elliott Sprehn 2013-07-11 17:31:33 UTC
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.

##### Comment 4 Travis Leithead [MSFT] 2013-07-11 18:14:40 UTC
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.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/15

Received on Tuesday, 6 October 2015 22:49:18 UTC