public class JsRange extends JsElementalMixinBase implements Range
END_TO_END, END_TO_START, NODE_AFTER, NODE_BEFORE, NODE_BEFORE_AND_AFTER, NODE_INSIDE, START_TO_END, START_TO_START
SVG_ZOOMANDPAN_DISABLE, SVG_ZOOMANDPAN_MAGNIFY, SVG_ZOOMANDPAN_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
JsRange() |
Modifier and Type | Method and Description |
---|---|
JsDocumentFragment |
cloneContents()
Returns a
DocumentFragment
copying the nodes of a Range. |
JsRange |
cloneRange()
Returns a Range object with boundary points identical to the cloned Range.
|
void |
collapse(boolean toStart)
Collapses the Range to one of its boundary points.
|
short |
compareNode(Node refNode)
Returns a constant representing whether the Node is before, after, inside, or surrounding the range.
|
short |
comparePoint(Node refNode,
int offset)
Returns -1, 0, or 1 indicating whether the point occurs before, inside, or after the range.
|
JsDocumentFragment |
createContextualFragment(String html)
Returns a
DocumentFragment
created from a given string of code. |
void |
deleteContents()
Removes the contents of a Range from the
Document
. |
void |
detach()
Releases Range from use to improve performance.
|
void |
expand(String unit) |
JsDocumentFragment |
extractContents()
Moves contents of a Range from the document tree into a
DocumentFragment
. |
JsClientRect |
getBoundingClientRect()
Returns a
ClientRect
object which bounds the entire contents of the range; this would be the union of all the rectangles returned by range.getClientRects()
. |
JsClientRectList |
getClientRects()
Returns a list of
ClientRect
objects that aggregates the results of Element.getClientRects()
for all the elements in the range. |
JsNode |
getCommonAncestorContainer()
Returns the deepest
Node
that contains the startContainer and endContainer Nodes. |
JsNode |
getEndContainer()
Returns the
Node
within which the Range ends. |
int |
getEndOffset()
Returns a number representing where in the endContainer the Range ends.
|
JsNode |
getStartContainer()
Returns the
Node
within which the Range starts. |
int |
getStartOffset()
Returns a number representing where in the startContainer the Range starts.
|
void |
insertNode(Node newNode)
Insert a
Node
at the start of a Range. |
boolean |
intersectsNode(Node refNode)
Returns a
boolean indicating whether the given node intersects the range. |
boolean |
isCollapsed()
Returns a
boolean indicating whether the range's start and end points are at the same position. |
boolean |
isPointInRange(Node refNode,
int offset)
Returns a
boolean indicating whether the given point is in the range. |
void |
selectNode(Node refNode)
Sets the Range to contain the
Node
and its contents. |
void |
selectNodeContents(Node refNode)
Sets the Range to contain the contents of a
Node
. |
void |
setEnd(Node refNode,
int offset)
Sets the end position of a Range.
|
void |
setEndAfter(Node refNode)
Sets the end position of a Range relative to another
Node
. |
void |
setEndBefore(Node refNode)
Sets the end position of a Range relative to another
Node
. |
void |
setStart(Node refNode,
int offset)
Sets the start position of a Range.
|
void |
setStartAfter(Node refNode)
Sets the start position of a Range relative to another
Node
. |
void |
setStartBefore(Node refNode)
Sets the start position of a Range relative to another
Node
. |
void |
surroundContents(Node newParent)
Moves content of a Range into a new
Node
. |
addEventListener, addEventListener, beginElement, beginElementAt, dispatchEvent, endElement, endElementAt, getAnimatedClassName, getAnimatedHeight, getAnimatedHref, getAnimatedResult, getAnimatedTransform, getAnimatedWidth, getAnimatedX, getAnimatedY, getBBox, getChildElementCount, getCTM, getExternalResourcesRequired, getFarthestViewportElement, getFirstElementChild, getLastElementChild, getNearestViewportElement, getNextElementSibling, getPresentationAttribute, getPreserveAspectRatio, getPreviousElementSibling, getRequiredExtensions, getRequiredFeatures, getScreenCTM, getSvgStyle, getSystemLanguage, getTransformToElement, getViewBox, getXmllang, getXmlspace, getZoomAndPan, hasExtension, querySelector, querySelectorAll, removeEventListener, removeEventListener, setXmllang, setXmlspace, setZoomAndPan
at, at, intAt, intAt, length, numberAt, numberAt, setAt, setAt, setAt, setAt, setAt, setAt
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
intAt, length
numberAt
public final boolean isCollapsed()
Range
boolean
indicating whether the range's start and end points are at the same position.isCollapsed
in interface Range
public final JsNode getCommonAncestorContainer()
Range
Node
that contains the startContainer and endContainer Nodes.getCommonAncestorContainer
in interface Range
public final JsNode getEndContainer()
Range
Node
within which the Range ends.getEndContainer
in interface Range
public final int getEndOffset()
Range
getEndOffset
in interface Range
public final JsNode getStartContainer()
Range
Node
within which the Range starts.getStartContainer
in interface Range
public final int getStartOffset()
Range
getStartOffset
in interface Range
public final JsDocumentFragment cloneContents()
Range
DocumentFragment
copying the nodes of a Range.cloneContents
in interface Range
public final JsRange cloneRange()
Range
cloneRange
in interface Range
public final void collapse(boolean toStart)
Range
public final short compareNode(Node refNode)
Range
compareNode
in interface Range
public final short comparePoint(Node refNode, int offset)
Range
comparePoint
in interface Range
public final JsDocumentFragment createContextualFragment(String html)
Range
DocumentFragment
created from a given string of code.createContextualFragment
in interface Range
public final void deleteContents()
Range
Document
.deleteContents
in interface Range
public final void detach()
Range
public final JsDocumentFragment extractContents()
Range
DocumentFragment
.extractContents
in interface Range
public final JsClientRect getBoundingClientRect()
Range
ClientRect
object which bounds the entire contents of the range; this would be the union of all the rectangles returned by range.getClientRects()
.getBoundingClientRect
in interface Range
public final JsClientRectList getClientRects()
Range
ClientRect
objects that aggregates the results of Element.getClientRects()
for all the elements in the range.getClientRects
in interface Range
public final void insertNode(Node newNode)
Range
Node
at the start of a Range.insertNode
in interface Range
public final boolean intersectsNode(Node refNode)
Range
boolean
indicating whether the given node intersects the range.intersectsNode
in interface Range
public final boolean isPointInRange(Node refNode, int offset)
Range
boolean
indicating whether the given point is in the range.isPointInRange
in interface Range
public final void selectNode(Node refNode)
Range
Node
and its contents.selectNode
in interface Range
public final void selectNodeContents(Node refNode)
Range
Node
.selectNodeContents
in interface Range
public final void setEnd(Node refNode, int offset)
Range
public final void setEndAfter(Node refNode)
Range
Node
.setEndAfter
in interface Range
public final void setEndBefore(Node refNode)
Range
Node
.setEndBefore
in interface Range
public final void setStart(Node refNode, int offset)
Range
public final void setStartAfter(Node refNode)
Range
Node
.setStartAfter
in interface Range
public final void setStartBefore(Node refNode)
Range
Node
.setStartBefore
in interface Range
public final void surroundContents(Node newParent)
Range
Node
.surroundContents
in interface Range
Copyright © 2018. All rights reserved.