Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Define .selectorText for CSSPseudoElement IDL
As resolved in #12161, add .selectorText property to return a
string representing the full, normalized selector text used to select
the pseudo-element.
  • Loading branch information
danielsakhapov committed Nov 27, 2025
commit 3a82041247cb09a49e351615274ffd9257c8cffd
10 changes: 10 additions & 0 deletions css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,7 @@ Additions to the CSS Object Model</h2>
readonly attribute CSSOMString type;
readonly attribute Element element;
readonly attribute (Element or CSSPseudoElement) parent;
readonly attribute CSSOMString selectorText;
CSSPseudoElement? pseudo(CSSOMString type);
};
</pre>
Expand Down Expand Up @@ -1793,6 +1794,15 @@ Additions to the CSS Object Model</h2>
{{CSSPseudoElement/parent}} will return a {{CSSPseudoElement}}
while {{CSSPseudoElement/element}} returns an {{Element}}.

The <dfn attribute for=CSSPseudoElement>selectorText</dfn> attribute
is a string representing the full, normalized selector text
used to select the pseudo-element.
This includes the pseudo-element name and any arguments,
serialized in a form that can round-trip.
For example, <code>"::after"</code> for a ''::after'' pseudo-element,
or <code>"::scroll-button(left)"</code> for a ''::scroll-button()'' pseudo-element
with a <code>left</code> argument.

The <dfn attribute for=CSSPseudoElement>pseudo(type)</dfn> method
returns the {{CSSPseudoElement}} interface
representing the [=sub-pseudo-element=] referenced in its argument,
Expand Down