CssPseudoElement Class

A pseudo-element of an element (https://drafts.csswg.org/css-pseudo-4/#CSSPseudoElement-interface), returned by Element.Pseudo: a tree-abiding pseudo-element that is not element-backed (::before, ::after, ::marker, ::backdrop, the scroll navigation controls, the view transition pseudo-elements...). The object exists whether or not the pseudo-element is generated, and the same object represents the same pseudo-element of the same originating element.

public sealed class CssPseudoElement

Remarks

The sub-pseudo-elements are the ::marker of ::before and ::after, and the view transition pseudo-elements, whose parent is their parent in the view transition tree without nested group (::view-transition > ::view-transition-group() > ::view-transition-image-pair() > ::view-transition-old() and ::view-transition-new()).

See also

Properties

NameDescription
ElementGets the ultimate originating element of the pseudo-element.
ParentGets the originating element of the pseudo-element, or its originating pseudo-element for a sub-pseudo-element.
SelectorTextGets the normalized selector of the pseudo-element, with its argument (e.g. ::scroll-button(inline-end)).
TypeGets the type of the pseudo-element: its name with the colons and without its argument (e.g. ::scroll-button).

Gets the ultimate originating element of the pseudo-element.

public Element Element { get; }

Gets the originating element of the pseudo-element, or its originating pseudo-element for a sub-pseudo-element.

public ElementOrCssPseudoElement Parent { get; }

Gets the normalized selector of the pseudo-element, with its argument (e.g. ::scroll-button(inline-end)).

public string SelectorText { get; }

Gets the type of the pseudo-element: its name with the colons and without its argument (e.g. ::scroll-button).

public string Type { get; }

Methods

NameDescription
ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?)Converts a point from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertpointfromnode).
ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?)Converts a quad from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode).
ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?)Converts a rectangle from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode).
GetBoxQuads(BoxQuadOptions?)Returns the quads of the boxes of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): one per box fragment, empty when the pseudo-element does not generate a box.
Pseudo(string)Returns the sub-pseudo-element of the pseudo-element designated by a pseudo-element selector, or null when it cannot exist (https://drafts.csswg.org/css-pseudo-4/#dom-csspseudoelement-pseudo): the ::marker of a ::before or ::after, or the child of a view transition pseudo-element of the same name.
ToString()Returns a string that represents the current object.

ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?)

CssPseudoElement.cs

Converts a point from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertpointfromnode).

public DomPoint ConvertPointFromNode(DomPointInit point, GeometryNode from, ConvertCoordinateOptions? options = null)

ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?)

CssPseudoElement.cs

Converts a quad from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode).

public DomQuad ConvertQuadFromNode(DomQuadInit quad, GeometryNode from, ConvertCoordinateOptions? options = null)

ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?)

CssPseudoElement.cs

Converts a rectangle from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode).

public DomQuad ConvertRectFromNode(DomRectReadOnly rect, GeometryNode from, ConvertCoordinateOptions? options = null)

GetBoxQuads(BoxQuadOptions?)

CssPseudoElement.cs

Returns the quads of the boxes of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): one per box fragment, empty when the pseudo-element does not generate a box.

public IReadOnlyList<DomQuad> GetBoxQuads(BoxQuadOptions? options = null)

Pseudo(string)

CssPseudoElement.cs

Returns the sub-pseudo-element of the pseudo-element designated by a pseudo-element selector, or null when it cannot exist (https://drafts.csswg.org/css-pseudo-4/#dom-csspseudoelement-pseudo): the ::marker of a ::before or ::after, or the child of a view transition pseudo-element of the same name.

public CssPseudoElement? Pseudo(string type)

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.