goog.dom.browserrange.OperaRange
Classgoog.dom.browserrange.OperaRange
> goog.dom.browserrange.W3cRange
> goog.dom.browserrange.AbstractRange
goog.dom.browserrange.OperaRange(range)
The constructor for Opera specific browser ranges.
range
{Range
}
.__iterator__(opt_keys)
Inherited from goog.dom.browserrange.AbstractRange
.
Returns a RangeIterator over the contents of the range. Regardless of the direction of the range, the iterator will move in document order.
opt_keys
{boolean
=}
goog.dom.RangeIterator
}
.clone()
Inherited from goog.dom.browserrange.W3cRange
.
goog.dom.browserrange.W3cRange
}
.collapse(toStart)
Inherited from goog.dom.browserrange.W3cRange
.
Collapses the range to one of its boundary points.
toStart
{boolean
}
.compareBrowserRangeEndpoints(range, thisEndpoint, otherEndpoint)
Inherited from goog.dom.browserrange.W3cRange
.
Compares one endpoint of this range with the endpoint of another browser native range object.
range
{Range
|TextRange
}
thisEndpoint
{goog.dom.RangeEndpoint
}
otherEndpoint
{goog.dom.RangeEndpoint
}
number
}
.containsNode(node, opt_allowPartial)
Inherited from goog.dom.browserrange.AbstractRange
.
Tests if this range contains the given node.
node
{Node
}
opt_allowPartial
{boolean
=}
boolean
}
.containsRange(abstractRange, opt_allowPartial)
Inherited from goog.dom.browserrange.AbstractRange
.
Tests if this range contains the given range.
abstractRange
{goog.dom.browserrange.AbstractRange
}
opt_allowPartial
{boolean
=}
boolean
}
.createFromNodeContents(node)
Creates a range object that selects the given node's text.
node
{Node
}
goog.dom.browserrange.OperaRange
}
.createFromNodes(startNode, startOffset, endNode, endOffset)
Creates a range object that selects between the given nodes.
startNode
{Node
}
startOffset
{number
}
endNode
{Node
}
endOffset
{number
}
goog.dom.browserrange.OperaRange
}
.getBrowserRange()
Inherited from goog.dom.browserrange.W3cRange
.
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.
Range
|TextRange
}
.getContainer()
Inherited from goog.dom.browserrange.W3cRange
.
Returns the deepest node in the tree that contains the entire range.
Node
}
.getEndNode()
Inherited from goog.dom.browserrange.W3cRange
.
Returns the node the range ends in.
Node
}
.getEndOffset()
Inherited from goog.dom.browserrange.W3cRange
.
Returns the offset into the node the range ends in.
number
}
.getHtmlFragment()
Inherited from goog.dom.browserrange.AbstractRange
.
Returns the HTML fragment this range selects. This is slow on all browsers.
string
}
.getStartNode()
Inherited from goog.dom.browserrange.W3cRange
.
Returns the node the range starts in.
Node
}
.getStartOffset()
Inherited from goog.dom.browserrange.W3cRange
.
Returns the offset into the node the range starts in.
number
}
.getText()
Inherited from goog.dom.browserrange.W3cRange
.
string
}
.getValidHtml()
Inherited from goog.dom.browserrange.W3cRange
.
Returns valid HTML for this range. This is fast on IE, and semi-fast on other browsers.
string
}
.insertNode(node, before)
Inherited from goog.dom.browserrange.W3cRange
.
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()
Inherited from goog.dom.browserrange.W3cRange
.
Tests if the selection is collapsed - i.e. is just a caret.
boolean
}
.removeContents()
Inherited from goog.dom.browserrange.W3cRange
.
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.
.select(opt_reverse)
Inherited from goog.dom.browserrange.W3cRange
.
Set this range as the selection in its window.
opt_reverse
{boolean
=}
.selectInternal(selection, reverse)
[protected]Select this range.
selection
{Selection
}
reverse
{*}
.surroundContents(element)
Inherited from goog.dom.browserrange.W3cRange
.
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.
element
{Element
}
Element
}
.surroundWithNodes(startNode, endNode)
Inherited from goog.dom.browserrange.W3cRange
.
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
}