Open george-steel opened 5 years ago
I think this can only make sense for tree-abiding pseudo-elements: ::marker
, ::before
and ::after
. Not for things like ::first-line
.
@flackr
The CSS Working Group just discussed [css-pseudo-4] Semantics of CSSPseudoElement : EventTarget
.
The CSSPseudoElement IDL specifies an inheritance from EventTarget, and this leaves a not a questions as to how enent handling on pseudo-elements should behave (which has no section on the spec). Is this interface only for animation events (transition events already target the parent but include a pseudoElement field to specify the pseudo-type)?
Currently system events (including click) which hit a pseudo-element are retargeted to the parent element before propagation. Should pseudo-elements be able to listen for these events, and if so, should
event.target
be the the pseudo-element (a breaking change) or the parent element.Also, while the current system of event bubbling is well-defined for for the tree hierarchy for elements, some pseudo-elements (first-line, selection) feature multiple inheritance. How would pseudo-element events handle this. In normal event handling, a bubbled event always bubbles to it's parent element. However, when dealing with pseudo-elements, we have (following CSS cascade rules) we have the chain parent -> parent::first-line -> child -> child::first-line How would we handle bubbling in this case? Do we break normal order and follow the CSS inheritance hierarchy? Do we propagate through all the pseudo-elements first?