
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_STARTSVG_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, setZoomAndPanat, at, intAt, intAt, length, numberAt, numberAt, setAt, setAt, setAt, setAt, setAt, setAtcast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toStringintAt, lengthnumberAtpublic final boolean isCollapsed()
Rangeboolean indicating whether the range's start and end points are at the same position.isCollapsed in interface Rangepublic final JsNode getCommonAncestorContainer()
RangeNode
that contains the startContainer and endContainer Nodes.getCommonAncestorContainer in interface Rangepublic final JsNode getEndContainer()
RangeNode
within which the Range ends.getEndContainer in interface Rangepublic final int getEndOffset()
RangegetEndOffset in interface Rangepublic final JsNode getStartContainer()
RangeNode
within which the Range starts.getStartContainer in interface Rangepublic final int getStartOffset()
RangegetStartOffset in interface Rangepublic final JsDocumentFragment cloneContents()
RangeDocumentFragment
copying the nodes of a Range.cloneContents in interface Rangepublic final JsRange cloneRange()
RangecloneRange in interface Rangepublic final void collapse(boolean toStart)
Rangepublic final short compareNode(Node refNode)
RangecompareNode in interface Rangepublic final short comparePoint(Node refNode, int offset)
RangecomparePoint in interface Rangepublic final JsDocumentFragment createContextualFragment(String html)
RangeDocumentFragment
created from a given string of code.createContextualFragment in interface Rangepublic final void deleteContents()
RangeDocument
.deleteContents in interface Rangepublic final void detach()
Rangepublic final JsDocumentFragment extractContents()
RangeDocumentFragment
.extractContents in interface Rangepublic final JsClientRect getBoundingClientRect()
RangeClientRect
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 Rangepublic final JsClientRectList getClientRects()
RangeClientRect
objects that aggregates the results of Element.getClientRects()
for all the elements in the range.getClientRects in interface Rangepublic final void insertNode(Node newNode)
RangeNode
at the start of a Range.insertNode in interface Rangepublic final boolean intersectsNode(Node refNode)
Rangeboolean indicating whether the given node intersects the range.intersectsNode in interface Rangepublic final boolean isPointInRange(Node refNode, int offset)
Rangeboolean indicating whether the given point is in the range.isPointInRange in interface Rangepublic final void selectNode(Node refNode)
RangeNode
and its contents.selectNode in interface Rangepublic final void selectNodeContents(Node refNode)
RangeNode
.selectNodeContents in interface Rangepublic final void setEnd(Node refNode, int offset)
Rangepublic final void setEndAfter(Node refNode)
RangeNode
.setEndAfter in interface Rangepublic final void setEndBefore(Node refNode)
RangeNode
.setEndBefore in interface Rangepublic final void setStart(Node refNode, int offset)
Rangepublic final void setStartAfter(Node refNode)
RangeNode
.setStartAfter in interface Rangepublic final void setStartBefore(Node refNode)
RangeNode
.setStartBefore in interface Rangepublic final void surroundContents(Node newParent)
RangeNode
.surroundContents in interface RangeCopyright © 2016. All rights reserved.