Repository navigation
Description
WebKittens
No response
Title of the proposal
CSSPseudoElement interface
URL to the spec
URL to the spec's repository
No response
Issue Tracker URL
No response
Explainer URL
No response
TAG Design Review URL
No response
Mozilla standards-positions issue URL
No response
WebKit Bugzilla URL
No response
Radar URL
No response
Description
With all the new resolutions, here is a new functionality of CSSPseudoElement:
CSSPseudoElement has the following:
- The type attribute is a string representing the type of the pseudo-element.
- The element attribute is the ultimate originating element of the pseudo-element.
- The parent attribute is the originating element of the pseudo-element (Either Element of CSSPseudoElement for nested pseudo-elements).
- The pseudo(type) method to retrieve nested pseudo-elements.
CSSPseudoElement supports GeometryUtils, meaning it has getBoxQuads(), convertQuadFromNode(), convertRectFromNode(), convertPointFromNode().
Specific events are now also extended to have .pseudoTarget that is either CSSPseudoElement (if interaction has been with pseudo-element) or null. This allows to have more specific information on the event origin, e.g. that not just ultimate originating element (Event.target) has been clicked, but more specifically that it was ::after. Note that the Event.target is unchanged so event only has extra info on pseudo-element interaction.
The events are MouseEvent, PointerEvent, FocusEvent, AnimationEvent, TransitionEvent, KeyboardEvent, TouchEvent.
Activity
danielsakhapov commentedon May 26, 2026
Addition - in w3c/csswg-drafts#13804 it was resolved that CSSPseudoElement now supports all standardized non-element-backed tree-abiding pseudo-elements.