goog.dom.browserrange.AbstractRange | |
goog.dom.browserrange.IeRange | goog.dom.browserrange.AbstractRange |
range
: TextRange
The range object.
|
doc
: Document
The document the range exists in.
|
![]()
Clears the cached values for containers.
|
code » | ||||
No description.
Returns: !goog.dom.browserrange.IeRange
A clone of this range.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
Compares one endpoint of this range with the endpoint of a node.
For internal methods, we should prefer this method to containsNode.
containsNode has a lot of false negatives when we're dealing with
<br> tags.
Arguments:
Returns: number
0 if the endpoints are equal, negative if this range
endpoint comes before the other node endpoint, and positive otherwise.
|
code » | ||||
Helper method to find the deepest parent for this range, starting
the search from
node , which must contain the range.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
Recurses to find the correct node for the given endpoint.
Arguments:
Returns: Node
The deepest node containing the endpoint.
|
code » | ||||
Returns the offset into the start/end container.
Arguments:
Returns: number
The offset.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
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: boolean
Whether the range is valid.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
No description.
|
code » |
Returns a RangeIterator over the contents of the range. Regardless of the
direction of the range, the iterator will move in document order.
Arguments:
Returns: !goog.dom.RangeIterator
An iterator over tags in the range.
|
code » | ||||
No description.
Returns: goog.dom.browserrange.AbstractRange
A clone of this range.
|
code » | ||||
![]()
Collapses the range to one of its boundary points.
Arguments:
|
code » | ||||
Compares one endpoint of this range with the endpoint of another browser
native range object.
Arguments:
Returns: number
0 if the endpoints are equal, negative if this range
endpoint comes before the other range endpoint, and positive otherwise.
|
code » | ||||
Tests if this range contains the given node.
|
code » | ||||
Tests if this range contains the given range.
Arguments:
Returns: boolean
Whether this range contains the given range.
|
code » | ||||
![]()
Returns the browser native implementation of the range. Please refrain from
using this function - if you find you need the range please add wrappers for
the functionality you need rather than just using the native range.
Returns: Range | TextRange
The browser native range object.
|
code » | ||||
Returns the deepest node in the tree that contains the entire range.
Returns: Node
The deepest node that contains the entire range.
|
code » | ||||
Returns the node the range ends in.
Returns: Node
The element or text node the range ends in.
|
code » | ||||
Returns the offset into the node the range ends in.
Returns: number
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: goog.math.Coordinate
The coordinate of the selection end node
and offset.
|
code » | ||||
Returns the HTML fragment this range selects. This is slow on all browsers.
Returns: string
HTML fragment of the range, does not include context
containing elements.
|
code » | ||||
Returns the node the range starts in.
Returns: Node
The element or text node the range starts in.
|
code » | ||||
Returns the offset into the node the range starts in.
Returns: number
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: goog.math.Coordinate
The coordinate of the selection start node
and offset.
|
code » | ||||
No description.
Returns: string
The text content of the range.
|
code » | ||||
Returns valid HTML for this range. This is fast on IE, and semi-fast on
other browsers.
Returns: string
Valid HTML of the range, including context containing
elements.
|
code » | ||||
Inserts a node before (or after) the range. The range may be disrupted
beyond recovery because of the way this splits nodes.
|
code » | ||||
Tests if the selection is collapsed - i.e. is just a caret.
Returns: boolean
Whether the range is collapsed.
|
code » | ||||
![]()
Set this range as the selection in its window.
Arguments:
|
code » | ||||
Surrounds the text range with the specified element (on Mozilla) or with a
clone of the specified element (on IE). Returns a reference to the
surrounding element if the operation was successful; returns null if the
operation failed.
|
code » | ||||
![]()
Surrounds this range with the two given nodes. The range may be disrupted
beyond recovery because of the way this splits nodes.
|
code » |
![]()
No description.
|
Code » | |
![]()
The document the range exists in.
|
Code » | |
![]()
Lazy cache of the node containing the end of the selection.
|
Code » | |
![]()
Lazy cache of the offset in endNode_ where this range ends.
|
Code » | |
![]()
Lazy cache of the node containing the entire selection.
|
Code » | |
![]()
The browser range object this class wraps.
|
Code » | |
![]()
Lazy cache of the node containing the start of the selection.
|
Code » | |
![]()
Lazy cache of the offset in startNode_ where this range starts.
|
Code » |
![]()
Removes the contents of the range from the document. As a side effect, the
selection will be collapsed. The behavior of content removal is normalized
across browsers. For instance, IE sometimes creates extra text nodes that
a W3C browser does not. That behavior is corrected for.
|
Code » |
Create a range object that selects the given node's text.
Arguments:
Returns: !goog.dom.browserrange.IeRange
An IE range wrapper object.
|
code » | |||||
![]()
Static method that returns the proper type of browser range.
Arguments:
Returns: !goog.dom.browserrange.AbstractRange
A wrapper object.
|
code » | |||||
![]()
Returns a browser range spanning the given node's contents.
Arguments:
Returns: !TextRange
A browser range spanning the node's contents.
|
code » | |||||
![]()
Returns a browser range spanning the given nodes.
|
code » | |||||
No description.
Arguments:
Returns: !goog.dom.DomHelper
A dom helper for the document the range
resides in.
|
code » | |||||
Returns the text of the given node. Uses IE specific properties.
|
code » | |||||
Internal handler for inserting a node.
|
code » | |||||
Pastes the given element into the given range, returning the resulting
element.
|
code » |