goog.dom.Range
Namespace.clearSelection(opt_win)
Clears the window's selection.
opt_win
{Window
=}
.createCaret(node, offset)
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.
node
{Node
}
offset
{number
}
goog.dom.AbstractRange
}
.createFromBrowserRange(range, opt_isReversed)
Create a new range wrapper from the given browser range object.
range
{Range
|TextRange
}
opt_isReversed
{boolean
=}
goog.dom.AbstractRange
}
.createFromBrowserSelection(selection)
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.
selection
{!Object
}
goog.dom.AbstractRange
?}
.createFromNodeContents(node, opt_isReversed)
Create a new range wrapper that selects the given node's text.
node
{Node
}
opt_isReversed
{boolean
=}
goog.dom.AbstractRange
}
.createFromNodes(startNode, startOffset, endNode, endOffset)
Create a new range wrapper that selects the area between the given nodes, accounting for the given offsets.
startNode
{Node
}
startOffset
{number
}
endNode
{Node
}
endOffset
{number
}
goog.dom.AbstractRange
}
.createFromWindow(opt_win)
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.
opt_win
{Window
=}
goog.dom.AbstractRange
?}
.hasSelection(opt_win)
Tests if the window has a selection.
opt_win
{Window
=}
boolean
}
.isReversed(anchorNode, anchorOffset, focusNode, focusOffset)
Returns whether the focus position occurs before the anchor position.
anchorNode
{Node
}
anchorOffset
{number
}
focusNode
{Node
}
focusOffset
{number
}
boolean
}