Skip to content

CSSPseudoElement interface #607

Open

Description

@danielsakhapov

WebKittens

No response

Title of the proposal

CSSPseudoElement interface

URL to the spec

https://drafts.csswg.org/css-pseudo/#CSSPseudoElement-interface

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

  1. added
    topic: css
    on Jan 27, 2026
  2. danielsakhapov commented on May 26, 2026

    @danielsakhapov
    Author

    Addition - in w3c/csswg-drafts#13804 it was resolved that CSSPseudoElement now supports all standardized non-element-backed tree-abiding pseudo-elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

topic: cssvenue: W3C CSS WG

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions