Skip to content

OpaqueRange: cross-post from whatwg/html#11478 for DOM community input #1468

Description

@stephanieyzhang

What is the issue with the DOM Standard?

Cross-posting from whatwg/html#11478 to get DOM community input on OpaqueRange, a proposed new AbstractRange subclass for encapsulated content.

OpaqueRange represents a live span of content within a host element, so developers can work with that content using range-like APIs. For <textarea> and text-based <input>, that content is the element's value text. The design also has a path to custom elements, so authors can expose encapsulated ranges over their own internal content in the future.

It enables operations such as getBoundingClientRect(), getClientRects(), and integration with the CSS Custom Highlight API for UI such as inline suggestions, highlights, and anchored popovers. It preserves encapsulation by exposing only offsets while not exposing the underlying nodes, so the host element's internal structure stays hidden.

Relevant links:

Posting here so DOM reviewers can weigh in. Please keep discussion to whatwg/html#11478. This issue is mainly a pointer for visibility.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions