Repository navigation
Description
Description
The current Range interface methods do not support retrieving or creating ranges that represent the value (rather than the element itself) of <textarea> and <input> elements. As a result, if web developers want to use the getBoundingClientRect() method in a <textarea> or <input> element to position a popup beneath the user's current caret for delivering contextual autocomplete suggestions or marking syntax errors as users type using the Custom Highlight API, they must find workarounds. These workarounds often involve cloning these elements and their styles into <div>s, which is both difficult to maintain and may impact the web application's performance.
OpaqueRange is a new AbstractRange subclass that references spans of encapsulated content within elements whose internal structures are not exposed to authors, like <textarea> and <input>.
See here (discussion) for an example of a rich-input web component that is made possible by OpaqueRange.
Support for OpaqueRange landed in Chrome 152.
Specification
- WHATWG: OpaqueRange Interface whatwg/html#11478
- CSSWG: [cssom-1] A more direct method than
caretPositionFromPoint()w3c/csswg-drafts#10346 - TPAC 2025 Meeting Minutes: https://www.w3.org/2025/11/11-whatwg-minutes.html
- Design review: Other Spec Review: OpaqueRange w3ctag/design-reviews#1206
web-feature
opaquerange
Test Links
Additional Signals
- Mozilla: OpaqueRange: AbstractRange subtype for encapsulated content (<input>, <textarea>) mozilla/standards-positions#1289 and OpaqueRange Interface whatwg/html#11478 (comment)
- WebKit: OpaqueRange: AbstractRange subtype for encapsulated content (<input>, <textarea>) WebKit/standards-positions#541
- OpaqueRange web-platform-dx/developer-signals#579
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
github-actions commentedon Sep 15, 2026
This comment was automatically generated based on the information you provided. Please don't edit it.
Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
If this doesn't accurately correspond to your proposal, please update your initial comment to include
web-features: <feature-id>.To find feature IDs, use the web-features explorer.
Feature OpaqueRange
createValueRange()for form elements, such as<textarea>or<input type="text">, gets anOpaqueRangeobject that represents a live span of text. You can use this for range-based operations on the input text, such as setting custom highlights or placing autocomplete popovers.jgraham commentedon Sep 17, 2026
This appears to only have tentative tests and no stable spec? If that's correct, and we don't expect a stable spec and non-tentative testsuite in the next few weeks, this doesn't meet the formal criteria for this round of Interop.