Text Class

https://dom.spec.whatwg.org/#interface-text

public class Text : CharacterData
Inheritance
CharacterData Text

Constructors

NameDescription
Text(string)Creates a text node with the given data.

Text(string)

CharacterData.cs

Creates a text node with the given data.

public Text(string data = "")

Properties

NameDescription
AssignedSlotGets the open shadow tree slot the text node is assigned to, or null when it is not assigned.
NodeNameGets the name of the node, which is always #text.
NodeTypeGets the type of the node, which is always TEXT_NODE.
WholeTexthttps://dom.spec.whatwg.org/#dom-text-wholetext

AssignedSlot

CharacterData.cs

Gets the open shadow tree slot the text node is assigned to, or null when it is not assigned.

public HtmlSlotElement? AssignedSlot { get; }

Gets the name of the node, which is always #text.

public override string NodeName { get; }

Property value

string

Gets the type of the node, which is always TEXT_NODE.

public override ushort NodeType { get; }

Property value

ushort

https://dom.spec.whatwg.org/#dom-text-wholetext

public string WholeText { get; }

Methods

NameDescription
ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?)Converts a point from the coordinates of a node to the coordinates of the text (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 text, which are the ones of its parent 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 text (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode).
GetBoxQuads(BoxQuadOptions?)Returns the quads of the text (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): the rectangles of its text fragments (see Range.GetClientRects), in the coordinates of the viewport or of BoxQuadOptions.RelativeTo.
SplitText(uint)https://dom.spec.whatwg.org/#concept-text-split

ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?)

CssomView.GeometryUtils.cs

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

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

ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?)

CssomView.GeometryUtils.cs

Converts a quad from the coordinates of a node to the coordinates of the text, which are the ones of its parent element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode).

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

ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?)

CssomView.GeometryUtils.cs

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

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

GetBoxQuads(BoxQuadOptions?)

CssomView.GeometryUtils.cs

Returns the quads of the text (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): the rectangles of its text fragments (see Range.GetClientRects), in the coordinates of the viewport or of BoxQuadOptions.RelativeTo.

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

SplitText(uint)

CharacterData.cs

https://dom.spec.whatwg.org/#concept-text-split

public Text SplitText(uint offset)