CaretPosition Class

A caret position (https://drafts.csswg.org/cssom-view/#caretposition): a node and an offset in it, returned by Document.CaretPositionFromPoint.

public sealed class CaretPosition

Properties

NameDescription
OffsetGets the offset of the caret position in its node (https://drafts.csswg.org/cssom-view/#dom-caretposition-offset).
OffsetNodeGets the node of the caret position (https://drafts.csswg.org/cssom-view/#dom-caretposition-offsetnode).

Gets the offset of the caret position in its node (https://drafts.csswg.org/cssom-view/#dom-caretposition-offset).

public uint Offset { get; }

Gets the node of the caret position (https://drafts.csswg.org/cssom-view/#dom-caretposition-offsetnode).

public Node OffsetNode { get; }

Methods

NameDescription
GetClientRect()Returns the rectangle of the caret (https://drafts.csswg.org/cssom-view/#dom-caretposition-getclientrect): the bounding rectangle of the collapsed range of the caret position (see Range.GetBoundingClientRect), or null when the node is not in a document anymore.

GetClientRect()

CaretPosition.cs

Returns the rectangle of the caret (https://drafts.csswg.org/cssom-view/#dom-caretposition-getclientrect): the bounding rectangle of the collapsed range of the caret position (see Range.GetBoundingClientRect), or null when the node is not in a document anymore.

public DomRect? GetClientRect()