Intent to Experiment: OpaqueRange

24 views
Skip to first unread message

Stephanie Zhang

unread,
2:29 PM (2 hours ago) 2:29 PM
to blin...@chromium.org
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
OpaqueRange adds new methods (e.g., createValueRange()) to <textarea> and text <input> elements so authors can create ranges over value text. It doesn’t change existing editing or selection behavior, so the risk to existing sites is low. The main interoperability risk is lack of implementation across engines, which could make text-anchored UI or highlights inside native controls work in only some browsers.

Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1289)

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/541)

Web developers: Positive (https://github.com/w3c/csswg-drafts/issues/10346) Another positive example: https://github.com/whatwg/html/issues/11478

Other signals:
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.
Is this feature fully tested by web-platform-tests?
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
This intent message was generated by Chrome Platform Status.
 
 

Alex Russell

unread,
2:44 PM (2 hours ago) 2:44 PM
to blink-dev, Stephanie Zhang
First, thanks for the thorough and code-focused Explainer; nicely done.

Are any of the existing Range-producing APIs modified here? I.e., do they now return OpaqueRange objects rather than (transparent) Range responses if, e.g., they happen to include an <input>?

Also, are there any reasons not to ship now? E.g., are there partners lined up waiting to try OpaqueRange that we can learn from?

Regardless, LGTM1 to experiment for 3 releases.

On Monday, March 23, 2026 at 11:29:56 AM UTC-7 Stephanie Zhang wrote:
Reply all
Reply to author
Forward
0 new messages