goog.dom.AbstractMultiRange
Provided By | |
---|---|
Extends | |
All Known Direct Subclasses |
Creates a new multi range with no properties. Do not use this constructor: use one of the goog.dom.Range.createFrom* methods instead.
new AbstractMultiRange()
Parameters | None. |
---|
Instance Methods
this.__iterator__( opt_keys ) → goog.dom.RangeIterator
goog.dom.RangeIterator
Returns a RangeIterator over the contents of the range. Regardless of the direction of the range, the iterator will move in document order.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.clone() → goog.dom.AbstractRange
goog.dom.AbstractRange
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.collapse( toAnchor ) → void
void
Collapses the range to one of its boundary points.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.containsNode( node, opt_allowPartial ) → boolean
boolean
this.containsRange( range, opt_allowPartial ) → boolean
boolean
Tests if this range contains the given range.
Overrides | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.getAnchorNode() → (Node|null)
(Node|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getAnchorOffset() → number
number
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getBrowserRangeObject() → (Range|TextRange|null)
(Range|TextRange|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getContainer() → (Node|null)
(Node|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getContainerElement() → (Element|null)
(Element|null)
Returns the deepest element in the tree that contains the entire range.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getDocument() → Document
Document
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getEndNode() → (Node|null)
(Node|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getEndOffset() → number
number
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getEndPosition() → (goog.math.Coordinate|null)
(goog.math.Coordinate|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getFocusNode() → (Node|null)
(Node|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getFocusOffset() → number
number
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getHtmlFragment() → string
string
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 #getValidHtml
instead.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getPastableHtml() → string
string
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.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getStartNode() → (Node|null)
(Node|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getStartOffset() → number
number
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getStartPosition() → (goog.math.Coordinate|null)
(goog.math.Coordinate|null)
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getText() → string
string
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getTextRange( i ) → (goog.dom.AbstractRange|null)
(goog.dom.AbstractRange|null)
Get the i-th text range in this range. The behavior is undefined if i >= getTextRangeCount or i < 0.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.getTextRangeCount() → number
number
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getTextRanges() → Array<(goog.dom.AbstractRange|null)>
Array<(goog.dom.AbstractRange|null)>
Gets an array of all text ranges this range is comprised of. For non-multi ranges, returns a single element array containing this.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getType() → goog.dom.RangeType
goog.dom.RangeType
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getValidHtml() → string
string
Returns valid HTML for this range. This is fast on IE, and semi-fast on other browsers.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getWindow() → Window
Window
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.insertNode( node, before ) → (Node|null)
(Node|null)
Inserts a node before (or after) the range. The range may be disrupted beyond recovery because of the way this splits nodes.
Overrides | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.isCollapsed() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isRangeInDocument() → boolean
boolean
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.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isReversed() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.removeContents() → void
void
Removes the contents of the range from the document.
this.replaceContentsWithNode( node ) → (Node|null)
(Node|null)
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.saveUsingCarets() → (goog.dom.AbstractSavedCaretRange|null)
(goog.dom.AbstractSavedCaretRange|null)
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.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.saveUsingDom() → goog.dom.SavedRange
goog.dom.SavedRange
Saves the range so that if the start and end nodes are left alone, it can be restored.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.select() → void
void
Sets this range as the selection in its window.
this.setBrowserRangeObject( nativeRange ) → boolean
boolean
Sets the native browser range object, overwriting any state this range was storing.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.surroundWithNodes( startNode, endNode ) → void
void
Surrounds this range with the two given nodes. The range may be disrupted beyond recovery because of the way this splits nodes.
Overrides | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|