Skip to content

OpaqueRange #1401

Open
Open

Description

@mkrause

Description

Explainer: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/OpaqueRange/explainer.md

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.

Image

Support for OpaqueRange landed in Chrome 152.

Specification

web-feature

opaquerange

Test Links

Additional Signals

Activity

  1. github-actions commented on Sep 15, 2026

    @github-actions

    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

    • ID: opaquerange
    • Name: OpaqueRange
    • Description: The createValueRange() for form elements, such as <textarea> or <input type="text">, gets an OpaqueRange object 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.
    • Baseline status: Limited Availability
    • Developer signals: 7 votes / 1 use case (details)
    • More information: See the web-features explorer
  2. jgraham commented on Sep 17, 2026

    @jgraham
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focus-area-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions