Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium Closure Dom Selection

From Leeroopedia
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

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)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment