goog.dom.Range
Functions
clearSelection( opt_win ) → void
void
Clears the window's selection.
Parameters |
|
---|
createCaret( node, offset ) → goog.dom.AbstractRange
goog.dom.AbstractRange
Create a new range wrapper that represents a caret at the given node, accounting for the given offset. This always creates a TextRange, regardless of whether node is an image node or other control range type node.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
createFromBrowserRange( range, opt_isReversed ) → goog.dom.AbstractRange
goog.dom.AbstractRange
Create a new range wrapper from the given browser range object.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
createFromBrowserSelection( selection ) → (goog.dom.AbstractRange|null)
(goog.dom.AbstractRange|null)
Create a new range wrapper from the given browser selection object. Note that this object does not auto-update if the user changes their selection and should be used as a snapshot.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
createFromNodeContents( node, opt_isReversed ) → goog.dom.AbstractRange
goog.dom.AbstractRange
Create a new range wrapper that selects the given node's text.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
createFromNodes( anchorNode, anchorOffset, focusNode, focusOffset ) → goog.dom.AbstractRange
goog.dom.AbstractRange
Create a new range wrapper that selects the area between the given nodes, accounting for the given offsets.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
createFromWindow( opt_win ) → (goog.dom.AbstractRange|null)
(goog.dom.AbstractRange|null)
Create a new selection from the given browser window's current selection. Note that this object does not auto-update if the user changes their selection and should be used as a snapshot.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
hasSelection( opt_win ) → boolean
boolean
Tests if the window has a selection.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
isReversed( anchorNode, anchorOffset, focusNode, focusOffset ) → boolean
boolean
Returns whether the focus position occurs before the anchor position.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|