Table of Contents

Class AbstractRange

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The AbstractRange abstract interface is the base class upon which all DOM range types are defined. A range is an object that indicates the start and end points of a section of content within the document.

[Value("AbstractRange")]
public class AbstractRange
Inheritance
AbstractRange
Derived
Inherited Members

Remarks

NOTE

As an abstract interface, you will not directly instantiate an object of type AbstractRange. Instead, you will use the Range or StaticRange interfaces. To understand the difference between those two interfaces, and how to choose which is appropriate for your needs, consult each interface's documentation.

See also on MDN

Constructors

AbstractRange()

public AbstractRange()

Properties

Collapsed

The read-only collapsed property of the AbstractRange interface returns true if the range's start position and end position are the same.

[Value("collapsed")]
public bool Collapsed { get; }

Property Value

bool

A boolean value which is true if the range is collapsed. A collapsed range is one in which the start and end positions are the same, resulting in a zero-character-long range.

Remarks

A collapsed range is empty (containing no content), and specifies a single point in a DOM tree. To collapse a range, see the Collapse(bool) method.

See also on MDN

EndContainer

The read-only endContainer property of the AbstractRange interface returns the Node in which the end of the range is located.

[Value("endContainer")]
public Node EndContainer { get; }

Property Value

Node

The Node which contains the last character of the range.

Remarks

To change the end position, use the SetEnd(Node, ulong) method or a similar one.

See also on MDN

EndOffset

The endOffset property of the AbstractRange interface returns the offset into the end node of the range's end position.

[Value("endOffset")]
public ulong EndOffset { get; }

Property Value

ulong

An integer value indicating the number of characters into the Node indicated by EndContainer at which the final character of the range is located.If the endContainer is a Node of type Text, Comment, or CDATASection, then the offset is the number of characters from the start of the endContainer to the boundary point of the range. For other Node types, the endOffset is the number of child nodes between the start of the endContainer and the boundary point of the range.

Remarks

To change the end position, use the SetEnd(Node, ulong) method or a similar one.

See also on MDN

StartContainer

The read-only startContainer property of the AbstractRange interface returns the Node in which the start of the range is located.

[Value("startContainer")]
public Node StartContainer { get; }

Property Value

Node

The Node inside which the start position of the range is found.

Remarks

To change the start position, use the SetStart(Node, ulong) method or a similar one.

See also on MDN

StartOffset

The read-only startOffset property of the AbstractRange interface returns the offset into the start node of the range's start position.

[Value("startOffset")]
public ulong StartOffset { get; }

Property Value

ulong

An integer value indicating the number of characters into the Node indicated by StartContainer at which the first character of the range is located.If the startContainer is a Node of type Text, Comment, or CDATASection, then the offset is the number of characters from the start of the startContainer to the boundary point of the range. For other Node types, the startOffset is the number of child nodes between the start of the startContainer and the boundary point of the range.

Remarks

To change the start position, use the SetStart(Node, ulong) method or a similar one.

See also on MDN