package js.html
Available on js
The Range interface represents a fragment of a document that can contain nodes and parts of text nodes.
Documentation Range by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
staticinlineread onlyEND_TO_END:Int = 2staticinlineread onlyEND_TO_START:Int = 3staticinlineread onlySTART_TO_END:Int = 1staticinlineread onlySTART_TO_START:Int = 0new()Throws:
null |
DOMError |
|---|
read onlycollapsed:BoolReturns a Boolean indicating whether the range's start and end points are at the same position.
read onlycommonAncestorContainer:NodeReturns the deepest Node that contains the startContainer and endContainer nodes.
read onlyendContainer:NodeReturns the Node within which the Range ends.
read onlyendOffset:IntReturns a number representing where in the endContainer the Range ends.
read onlystartContainer:NodeReturns the Node within which the Range starts.
read onlystartOffset:IntReturns a number representing where in the startContainer the Range starts.
cloneContents():DocumentFragmentReturns a DocumentFragment copying the nodes of a Range.
Throws:
null |
DOMError |
|---|
cloneRange():RangeReturns a Range object with boundary points identical to the cloned Range.
collapse(toStart:Bool = false):VoidCollapses the Range to one of its boundary points.
compareBoundaryPoints(how:Int, sourceRange:Range):IntCompares the boundary points of the Range with another Range.
Throws:
null |
DOMError |
|---|
comparePoint(node:Node, offset:Int):IntReturns -1, 0, or 1 indicating whether the point occurs before, inside, or after the Range.
Throws:
null |
DOMError |
|---|
createContextualFragment(fragment:String):DocumentFragmentReturns a DocumentFragment created from a given string of code.
Throws:
null |
DOMError |
|---|
deleteContents():VoidRemoves the contents of a Range from the Document.
Throws:
null |
DOMError |
|---|
detach():VoidReleases the Range from use to improve performance.
extractContents():DocumentFragmentMoves contents of a Range from the document tree into a DocumentFragment.
Throws:
null |
DOMError |
|---|
getBoundingClientRect():DOMRectReturns a DOMRect object which bounds the entire contents of the Range; this would be the union of all the rectangles returned by range.getClientRects().
getClientRects():DOMRectListReturns a list of DOMRect objects that aggregates the results of Element.getClientRects() for all the elements in the Range.
insertNode(node:Node):VoidInsert a Node at the start of a Range.
Throws:
null |
DOMError |
|---|
intersectsNode(node:Node):BoolReturns a boolean indicating whether the given node intersects the Range.
Throws:
null |
DOMError |
|---|
isPointInRange(node:Node, offset:Int):BoolReturns a boolean indicating whether the given point is in the Range.
Throws:
null |
DOMError |
|---|
selectNode(refNode:Node):VoidSets the Range to contain the Node and its contents.
Throws:
null |
DOMError |
|---|
selectNodeContents(refNode:Node):VoidSets the Range to contain the contents of a Node.
Throws:
null |
DOMError |
|---|
setEnd(refNode:Node, offset:Int):VoidSets the end position of a Range.
Throws:
null |
DOMError |
|---|
setEndAfter(refNode:Node):VoidSets the end position of a Range relative to another Node.
Throws:
null |
DOMError |
|---|
setEndBefore(refNode:Node):VoidSets the end position of a Range relative to another Node.
Throws:
null |
DOMError |
|---|
setStart(refNode:Node, offset:Int):VoidSets the start position of a Range.
Throws:
null |
DOMError |
|---|
setStartAfter(refNode:Node):VoidSets the start position of a Range relative to another Node.
Throws:
null |
DOMError |
|---|
setStartBefore(refNode:Node):VoidSets the start position of a Range relative to another Node.
Throws:
null |
DOMError |
|---|
surroundContents(newParent:Node):VoidMoves content of a Range into a new Node.
Throws:
null |
DOMError |
|---|
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/Range.html