range.js
No description.

File Location

/goog/dom/range.js


Public Protected Private

Global Functions

goog.dom.Range.clearSelection(opt_win)
Clears the window's selection.
Arguments:
opt_win : Window=
The window to get the selection of. Defaults to the window this class was defined in.
code »
goog.dom.Range.createCaret(nodeoffset) !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.
Arguments:
node : Node
The node to place a caret at.
offset : number
The offset within the node to place the caret at.
Returns: !goog.dom.AbstractRange  A range wrapper object.
code »
goog.dom.Range.createFromBrowserRange(rangeopt_isReversed) !goog.dom.AbstractRange
Create a new range wrapper from the given browser range object.
Arguments:
range : Range | TextRange
The browser range object.
opt_isReversed : boolean=
Whether the focus node is before the anchor node.
Returns: !goog.dom.AbstractRange  A range wrapper object.
code »
goog.dom.Range.createFromBrowserSelection(selection) ?goog.dom.AbstractRange
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.
Arguments:
selection : !Object
The browser selection object.
Returns: ?goog.dom.AbstractRange  A range wrapper object or null if there was an error.
code »
goog.dom.Range.createFromNodeContents(nodeopt_isReversed) !goog.dom.AbstractRange
Create a new range wrapper that selects the given node's text.
Arguments:
node : Node
The node to select.
opt_isReversed : boolean=
Whether the focus node is before the anchor node.
Returns: !goog.dom.AbstractRange  A range wrapper object.
code »
goog.dom.Range.createFromNodes(anchorNodeanchorOffsetfocusNodefocusOffset) !goog.dom.AbstractRange
Create a new range wrapper that selects the area between the given nodes, accounting for the given offsets.
Arguments:
anchorNode : Node
The node to anchor on.
anchorOffset : number
The offset within the node to anchor on.
focusNode : Node
The node to focus on.
focusOffset : number
The offset within the node to focus on.
Returns: !goog.dom.AbstractRange  A range wrapper object.
code »
goog.dom.Range.createFromWindow(opt_win) ?goog.dom.AbstractRange
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.
Arguments:
opt_win : Window=
The window to get the selection of. Defaults to the window this class was defined in.
Returns: ?goog.dom.AbstractRange  A range wrapper object, or null if there was an error.
code »
goog.dom.Range.hasSelection(opt_win) boolean
Tests if the window has a selection.
Arguments:
opt_win : Window=
The window to check the selection of. Defaults to the window this class was defined in.
Returns: boolean  Whether the window has a selection.
code »
goog.dom.Range.isReversed(anchorNodeanchorOffsetfocusNodefocusOffset) boolean
Returns whether the focus position occurs before the anchor position.
Arguments:
anchorNode : Node
The node to anchor on.
anchorOffset : number
The offset within the node to anchor on.
focusNode : Node
The node to focus on.
focusOffset : number
The offset within the node to focus on.
Returns: boolean  Whether the focus position occurs before the anchor position.
code »

Directory dom

File Reference