Implementation:SeleniumHQ Selenium Closure Dom Selection
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing text selection utilities for input elements used by Selenium JavaScript atoms.
Description
goog.dom.selection is a vendored copy of the Google Closure Library module. It provides utilities for working with text selections in input boxes and text areas, including getting and setting selection start/end positions, cursor positioning, and reading/writing selected text. It includes cross-browser handling for IE's TextRange model and newline character normalization. Selenium uses this as part of its JavaScript atom infrastructure for browser automation commands.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. It is not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/dom/selection.js
- Lines: 1-398
Key Exports
goog.provide('goog.dom.selection');
// Key exported functions:
goog.dom.selection.setStart(textfield, pos)
goog.dom.selection.getStart(textfield)
goog.dom.selection.setEnd(textfield, pos)
goog.dom.selection.getEnd(textfield)
goog.dom.selection.getEndPoints(textfield)
goog.dom.selection.setCursorPosition(textfield, pos)
goog.dom.selection.setText(textfield, text)
goog.dom.selection.getText(textfield)