Re: [csswg-drafts] How to handle addEventListener on `CSSPseudoElement`? (#12163)

> Allow direct listening with special dispatch phase

I think that invoking the listener on pseudo-elements before the entire standard dispatch is very weird. I would expect:

1. Capturing phase: event listeners with `capture` set to true, on ancestors, from the root towards the target
2. At target phase (1): event listeners with `capture` set to true, on the target element
3. **(new)** Pseudo-element phase (1): event listeners with `capture` set to true, on the target pseudo-element
4. **(new)** Pseudo-element phase (2): event listeners with `capture` set to false, on the target pseudo-element
5. At target phase (2): event listeners with `capture` set to false, on the target element
6. Bubbling phase: event listeners with `capture` set to false, on ancestors, from the the target towards the root. Only if the event bubbles.

It's still kinda weird that non-bubbling events will still bubble from the actual pseudo-element target to the ultimate originating element target.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 6 May 2025 22:54:31 UTC