goog.dom.MultiRange
Classgoog.dom.MultiRange
> goog.dom.AbstractMultiRange
> goog.dom.AbstractRange
goog.dom.MultiRange()
Creates a new multi part range with no properties. Do not use this constructor: use one of the goog.dom.Range.createFrom* methods instead.
.__iterator__()
.clone()
goog.dom.MultiRange
}
.collapse(toAnchor)
Collapses this range to a single point, either the first or last point depending on the parameter. This will result in the number of ranges in this multi range becoming 1.
toAnchor
{boolean
}
.containsNode(node, opt_allowPartial)
Inherited from goog.dom.AbstractRange
.
Tests if this range contains the given node.
node
{Node
}
opt_allowPartial
{boolean
=}
boolean
}
.containsRange(range, opt_allowPartial)
Inherited from goog.dom.AbstractMultiRange
.
Tests if this range contains the given range.
range
{goog.dom.AbstractRange
}
opt_allowPartial
{boolean
=}
boolean
}
.createFromBrowserRanges(browserRanges)
Creates a new range wrapper from the given browser ranges. Do not use this method directly - please use goog.dom.Range.createFrom* instead.
browserRanges
{Array
.<Range
>}
goog.dom.MultiRange
}
.createFromBrowserSelection(selection)
Creates a new range wrapper from the given browser selection object. Do not use this method directly - please use goog.dom.Range.createFrom* instead.
selection
{Selection
}
goog.dom.MultiRange
}
.createFromTextRanges(textRanges)
Creates a new range wrapper from the given goog.dom.TextRange objects. Do not use this method directly - please use goog.dom.Range.createFrom* instead.
textRanges
{Array
.<goog.dom.TextRange
>}
goog.dom.MultiRange
}
.getAnchorNode()
Inherited from goog.dom.AbstractRange
.
Node
}
.getAnchorOffset()
Inherited from goog.dom.AbstractRange
.
number
}
.getBrowserRangeObject()
.getContainer()
.getContainerElement()
Inherited from goog.dom.AbstractRange
.
Returns the deepest element in the tree that contains the entire range.
Element
}
.getDocument()
Inherited from goog.dom.AbstractRange
.
Document
}
.getEndNode()
.getEndOffset()
.getFocusNode()
Inherited from goog.dom.AbstractRange
.
Node
}
.getFocusOffset()
Inherited from goog.dom.AbstractRange
.
number
}
.getHtmlFragment()
.getPastableHtml()
.getSortedRanges()
Array
.<goog.dom.TextRange
>}
.getStartNode()
.getStartOffset()
.getText()
.getTextRange()
.getTextRangeCount()
.getTextRanges()
Inherited from goog.dom.AbstractRange
.
Gets an array of all text ranges this range is comprised of. For non-multi ranges, returns a single element array containing this.
Array
.<goog.dom.TextRange
>}
.getType()
.getValidHtml()
.getWindow()
Inherited from goog.dom.AbstractRange
.
Window
}
.insertNode(node, before)
Inherited from goog.dom.AbstractMultiRange
.
Inserts a node before (or after) the range. The range may be disrupted beyond recovery because of the way this splits nodes.
node
{Node
}
before
{boolean
}
Node
}
.isCollapsed()
.isRangeInDocument()
.isReversed()
Inherited from goog.dom.AbstractRange
.
boolean
}
.removeContents()
.replaceContentsWithNode(node)
Inherited from goog.dom.AbstractRange
.
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.
node
{Node
}
Node
}
.saveUsingCarets()
Inherited from goog.dom.AbstractRange
.
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.
goog.dom.SavedCaretRange
?}
.saveUsingDom()
.select()
.setBrowserRangeObject()
.surroundWithNodes(startNode, endNode)
Inherited from goog.dom.AbstractMultiRange
.
Surrounds this range with the two given nodes. The range may be disrupted beyond recovery because of the way this splits nodes.
startNode
{Element
}
endNode
{Element
}