This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22569 - MouseEvent should have DOMString pseudoElement property like TransitionEvent
Summary: MouseEvent should have DOMString pseudoElement property like TransitionEvent
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - UI Events (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Gary Kacmarcik
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-03 23:53 UTC by Elliott Sprehn
Modified: 2015-10-06 22:49 UTC (History)
5 users (show)

See Also:


Attachments

Description 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.
Comment 5 Gary Kacmarcik 2015-10-06 22:49:08 UTC
Now tracking as: https://github.com/w3c/uievents/issues/15