Implementation:SeleniumHQ Selenium Closure SafeStyle
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing the SafeStyle type and its builders for safe CSS declaration handling, used by Selenium JavaScript atoms.
Description
goog.html.SafeStyle is a vendored copy of the Google Closure Library module. It provides a string-like object representing a sequence of CSS declarations (propertyName: propertyValue; ...) that carries the security type contract that its value will not cause untrusted script execution (XSS) when evaluated as CSS in a browser. Instances must be created via factory methods (SafeStyle.create or SafeStyle.fromConstant) and are composable. SafeStyle values may never contain literal angle brackets. 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/html/safestyle.js
- Lines: 1-577
Key Exports
goog.module('goog.html.SafeStyle');
// Final class: SafeStyle
// Implements: goog.string.TypedString
// Factory methods: SafeStyle.create, SafeStyle.fromConstant
// Security type for safe CSS declaration strings preventing XSS.