Range class

The interface represents a fragment of a document that can contain nodes and parts of text nodes. A range can be created by using the Document.createRange() method. Range objects can also be retrieved by using the getRangeAt() method of the Selection object or the caretRangeFromPoint() method of the Document object. There also is the Range() constructor available.

AbstractRange

Range

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Range()
factory

Properties

collapsed bool

Available on AbstractRange, provided by the PropsAbstractRange extension

no setter
commonAncestorContainer Node

Available on Range, provided by the PropsRange extension

no setter
endContainer Node

Available on AbstractRange, provided by the PropsAbstractRange extension

no setter
endOffset int

Available on AbstractRange, provided by the PropsAbstractRange extension

no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startContainer Node

Available on AbstractRange, provided by the PropsAbstractRange extension

no setter
startOffset int

Available on AbstractRange, provided by the PropsAbstractRange extension

no setter

Methods

cloneContents() DocumentFragment

Available on Range, provided by the PropsRange extension

cloneRange() Range

Available on Range, provided by the PropsRange extension

collapse([bool? toStart = false]) → void

Available on Range, provided by the PropsRange extension

compareBoundaryPoints(int how, Range sourceRange) int

Available on Range, provided by the PropsRange extension

comparePoint(Node node, int offset) int

Available on Range, provided by the PropsRange extension

createContextualFragment(String fragment) DocumentFragment

Available on Range, provided by the PropsRange extension

deleteContents() → void

Available on Range, provided by the PropsRange extension

detach() → void

Available on Range, provided by the PropsRange extension

extractContents() DocumentFragment

Available on Range, provided by the PropsRange extension

getBoundingClientRect() DOMRect

Available on Range, provided by the PropsRange extension

getClientRects() DOMRectList

Available on Range, provided by the PropsRange extension

insertNode(Node node) → void

Available on Range, provided by the PropsRange extension

intersectsNode(Node node) bool

Available on Range, provided by the PropsRange extension

isPointInRange(Node node, int offset) bool

Available on Range, provided by the PropsRange extension

mToString() String

Available on Range, provided by the PropsRange extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
selectNode(Node node) → void

Available on Range, provided by the PropsRange extension

selectNodeContents(Node node) → void

Available on Range, provided by the PropsRange extension

setEnd(Node node, int offset) → void

Available on Range, provided by the PropsRange extension

setEndAfter(Node node) → void

Available on Range, provided by the PropsRange extension

setEndBefore(Node node) → void

Available on Range, provided by the PropsRange extension

setStart(Node node, int offset) → void

Available on Range, provided by the PropsRange extension

setStartAfter(Node node) → void

Available on Range, provided by the PropsRange extension

setStartBefore(Node node) → void

Available on Range, provided by the PropsRange extension

surroundContents(Node newParent) → void

Available on Range, provided by the PropsRange extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

endToEnd int
no setter
endToStart int
no setter
startToEnd int
no setter
startToStart int
no setter