Objectgoog.dom.AbstractRange
Returns a RangeIterator over the contents of the range. Regardless of the
direction of the range, the iterator will move in document order.
Returns:
An iterator over tags in the range.
|
code » | ||
No description.
Returns:
A clone of this range.
|
code » | ||
![]()
Collapses the range to one of its boundary points.
|
code » | ||
Tests if this range contains the given node.
|
code » | ||
Tests if this range contains the given range.
Returns:
Whether this range contains the given range.
|
code » | ||
No description.
Returns:
The element or text node the range is anchored at.
|
code » | ||
No description.
Returns:
The offset into the node the range is anchored at. For text nodes, this is an offset into the node value. For elements, this is an offset into the childNodes array.
|
code » | ||
![]() Range | TextRange
No description.
Returns:
Range | TextRange
The native browser range object.
|
code » | ||
No description.
Returns:
The deepest node that contains the entire range.
|
code » | ||
Returns the deepest element in the tree that contains the entire range.
Returns:
The deepest element that contains the entire range.
|
code » | ||
No description.
Returns:
The document this selection is a part of.
|
code » | ||
No description.
Returns:
The element or text node the range ends in.
|
code » | ||
No description.
Returns:
The offset into the node the range ends in. For text nodes, this is an offset into the node value. For elements, this is an offset into the childNodes array.
|
code » | ||
No description.
Returns:
The element or text node the range is focused at - i.e. where the cursor is.
|
code » | ||
No description.
Returns:
The offset into the node the range is focused at - i.e. where the cursor is. For text nodes, this is an offset into the node value. For elements, this is an offset into the childNodes array.
|
code » | ||
Returns the HTML fragment this range selects. This is slow on all browsers.
The HTML fragment may not be valid HTML, for instance if the user selects
from a to b inclusively in the following html:
>div<a>/div<b
This method will return
a</div>b
If you need valid HTML, use {@link #getValidHtml} instead.
Returns:
HTML fragment of the range, does not include context containing elements.
|
code » | ||
Returns pastable HTML for this range. This guarantees that any child items
that must have specific ancestors will have them, for instance all TDs will
be contained in a TR in a TBODY in a TABLE and all LIs will be contained in
a UL or OL as appropriate. This is semi-fast on all browsers.
Returns:
Pastable HTML of the range, including context containing elements.
|
code » | ||
No description.
Returns:
The element or text node the range starts in. For text ranges, the range comprises all text between the start and end position. For other types of range, start and end give bounds of the range but do not imply all nodes in those bounds are selected.
|
code » | ||
No description.
Returns:
The offset into the node the range starts in. For text nodes, this is an offset into the node value. For elements, this is an offset into the childNodes array.
|
code » | ||
No description.
Returns:
The text content of the range.
|
code » | ||
Get the i-th text range in this range. The behavior is undefined if
i >= getTextRangeCount or i < 0.
Returns:
The i-th text range.
|
code » | ||
No description.
Returns:
The number of text ranges in this range.
|
code » | ||
Gets an array of all text ranges this range is comprised of. For non-multi
ranges, returns a single element array containing this.
Returns:
Array of text ranges.
|
code » | ||
![]() goog.dom.RangeType
No description.
Returns:
goog.dom.RangeType
The type of range represented by this object.
|
code » | ||
Returns valid HTML for this range. This is fast on IE, and semi-fast on
other browsers.
Returns:
Valid HTML of the range, including context containing elements.
|
code » | ||
No description.
Returns:
The window this selection is a part of.
|
code » | ||
Inserts a node before (or after) the range. The range may be disrupted
beyond recovery because of the way this splits nodes.
Returns:
The node added to the document. This may be different than the node parameter because on IE we have to clone it.
|
code » | ||
No description.
Returns:
Whether the range is collapsed.
|
code » | ||
Tests whether this range is valid (i.e. whether its endpoints are still in
the document). A range becomes invalid when, after this object was created,
either one or both of its endpoints are removed from the document. Use of
an invalid range can lead to runtime errors, particularly in IE.
Returns:
Whether the range is valid.
|
code » | ||
No description.
Returns:
Whether the selection is reversed.
|
code » | ||
![]()
No description.
|
code » | ||
Replaces the range contents with (possibly a copy of) the given node. The
range may be disrupted beyond recovery because of the way this splits nodes.
|
code » | ||
Saves the range using HTML carets. As long as the carets remained in the
HTML, the range can be restored...even when the HTML is copied across
documents.
Returns:
A range representation that can be restored as long as carets are not removed. Returns null if carets could not be created.
|
code » | ||
Saves the range so that if the start and end nodes are left alone, it can
be restored.
Returns:
A range representation that can be restored as long as the endpoint nodes of the selection are not modified.
|
code » | ||
![]()
No description.
|
code » | ||
Sets the native browser range object, overwriting any state this range was
storing.
Arguments:
Returns:
Whether the given range was accepted. If not, the caller will need to call goog.dom.Range.createFromBrowserRange to create a new range object.
|
code » | ||
![]()
Surrounds this range with the two given nodes. The range may be disrupted
beyond recovery because of the way this splits nodes.
|
code » |
Gets the browser native selection object from the given window.
|
code » | |
Tests if the given Object is a controlRange.
|
code » |