- From: CSS Meeting Bot via GitHub <noreply@w3.org>
- Date: Thu, 30 Oct 2025 16:05:22 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed ``How to handle addEventListener on `CSSPseudoElement`?``, and agreed to the following: * `RESOLVED: pseudoTarget on selected event objects. no change to addEventListener. pseudoTarget is a CSSPseudoElement` <details><summary>The full IRC log of that discussion</summary> <noamr> sakhapov: let's time we didn't have objections but we didn't resolve<br> <noamr> sakhapov: it's a CSSPsuedoElement object, which is a proxy of a pseudo-element. we want to support events on it. it's not an EventTarget. Instead, we add a pseudoTarget property to event objects that refer to it<br> <cwilso> s/let's/last<br> <noamr> sakhapov: we don't need it for every event, just for some events where this is relevant<br> <noamr> sakhapov: seems like it covers the use cases while remaining compatible<br> <noamr> lea: pseudoTarget is part of the event object?<br> <noamr> sakhapov: yes, in specific event types<br> <emilio> q+<br> <noamr> annevk: ui/animation/transition events<br> <noamr> sakhapov: there is some precedent<br> <noamr> annevk: alway there<br> <noamr> sakhapov: it would be a CSSPseudoElement object<br> <noamr> lea: can a single event correspond to multiple pseudo-elements?<br> <noamr> lea: e.g. when clicking on one pseudo-element might be clicking on multiple pseudo-elements<br> <noamr> emilio: this can happen today with before/after<br> <noamr> dbaron: the target is the inner-most thing. But CSSPseudoElement might be able to traverse<br> <noamr> sakhapov: target is always the element. pseudoTarget is the deepest pseudo element. CSSPseudoElement would manage the chain, e.g. pseudoTarget.parent<br> <masonf> q+<br> <noamr> annevk: if you wanted to go there. or a "path" like in events today<br> <noamr> emilio: is that well defined with boundary events?<br> <noamr> sakhapov: this won't work for boundary events atm<br> <noamr> emilio: so the psuedoTarget for these is always null at the moment<br> <masonf> q-<br> <noamr> emilio: makes sense<br> <emilio> ack emilio<br> <noamr> sakhapov: worth to mention that CSSPseduoElement is identity consistent<br> <noamr> zcorpan: even if you display:none the element?<br> <noamr> sakhapov: yes, it's just a proxy<br> <noamr> annevk: is it reset at some point?<br> <noamr> sakhapov: I don't think it's spec'ed<br> <noamr> masonf: the proxy exists regardless of the element<br> <noamr> annevk: so elements outside of the tree have pseudo-elements?<br> <dbaron> dbaron: could have some sort of weak reference GC semantics?<br> <dbaron> noamr: a pseudo-element is just an element-string pair, you don't need that<br> <dbaron> s/pseudo-element/CSSPseudoElement/<br> <noamr> Proposed resolution: pseudoTarget on selected event objects. no change to addEventListener. pseudoTarget is a CSSPseudoElement<br> <noamr> RESOLVED: pseudoTarget on selected event objects. no change to addEventListener. pseudoTarget is a CSSPseudoElement<br> <noamr> github: end topic<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12163#issuecomment-3468779171 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 30 October 2025 16:05:23 UTC