Range Interface
The Range
object represents a fragment of a document that can contain nodes and parts of text nodes in a given document.
A range can be created using the Document.createRange
method of the Document
object. Range objects can also be retrieved by using the Selection.getRangeAt
method of the Selection
object.
Static Fields
Methods
Code DocumentFragment cloneContents() #
DocumentFragment
copying the nodes of a Range.
DocumentFragment cloneContents();
Code Range cloneRange() #
Range cloneRange();
Code void collapse(bool toStart) #
void collapse(bool toStart);
Code int comparePoint(Node refNode, int offset) #
int comparePoint(Node refNode, int offset);
Code DocumentFragment createContextualFragment(String html) #
DocumentFragment
created from a given string of code.
DocumentFragment createContextualFragment(String html);
Code void deleteContents() #
Code DocumentFragment extractContents() #
DocumentFragment
.
DocumentFragment extractContents();
Code ClientRect getBoundingClientRect() #
ClientRect
object which bounds the entire contents of the range; this would be the union of all the rectangles returned by range.getClientRects()
.
ClientRect getBoundingClientRect();
Code ClientRectList getClientRects() #
ClientRect
objects that aggregates the results of Element.getClientRects()
for all the elements in the range.
ClientRectList getClientRects();
Code bool intersectsNode(Node refNode) #
boolean
indicating whether the given node intersects the range.
bool intersectsNode(Node refNode);
Code bool isPointInRange(Node refNode, int offset) #
boolean
indicating whether the given point is in the range.
bool isPointInRange(Node refNode, int offset);
Code void setEnd(Node refNode, int offset) #
void setEnd(Node refNode, int offset);
Code void setStart(Node refNode, int offset) #
void setStart(Node refNode, int offset);
Fields
Code final bool collapsed #
boolean
indicating whether the range's start and end points are at the same position.
final bool collapsed;
Code final int endOffset #
final int endOffset;
Code final int startOffset #
final int startOffset;
This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.