Contact emails
Explainer
Specification
Summary
OpaqueRange represents a live span of text within a form control’s value (for example, a <textarea> or text <input>), so developers can work with value text using range-like APIs. It enables operations like getBoundingClientRect(), getClientRects(), and
use with the CSS Highlights API for UI such as inline suggestions, highlights, and anchored popovers. It preserves encapsulation by exposing only value offsets (and returning null for startContainer/endContainer), so DOM endpoints and internal structure aren’t
exposed.
Blink component
Web Feature ID
Missing feature
TAG review
TAG review status
Pending
Goals for experimentation
Validate API design and gather developer feedback on whether the API meets their needs.
Risks
Interoperability and Compatibility
Ergonomics
OpaqueRange is typically used with selection offsets and with geometry/highlighting APIs. The geometry calls are synchronous and can trigger layout, similar to existing Range geometry methods. Since the range is live, offsets are updated as the control’s
value is edited.
Activation
Moderate. Developers need to learn the value-offset model and how it differs from Range (there are no DOM endpoints).
Security
No new data exposure beyond existing access to form control values and selection. Exposes only value offsets and geometry and does not expose internal DOM (startContainer/endContainer are null).
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
Low. OpaqueRange adds a new method to <textarea> and text <input> elements, but does not change or deprecate any existing behavior
Ongoing technical constraints
None
Debuggability
No DevTools changes required.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes
Works on all platforms that support <input> and <textarea> elements.
Flag name on about://flags
N/A
Finch feature name
OpaqueRange
Requires code in //chrome?
False
Tracking bug
Measurement
UseCounter `OpaqueRange` measures successful creation of OpaqueRange objects on <textarea> and text <input> elements.
Estimated milestones
| Origin trial desktop first |
148 |
| DevTrial on desktop |
148 |
| Origin trial Android first |
148 |
| DevTrial on Android |
148 |
Link to entry on the Chrome Platform Status
Links to previous Intent discussions