web-platform-tests / web-platform-tests/interop

OpaqueRange

Open
#1,401 2 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

focus-area-proposal
Dominant language
JavaScript
Stars
524
Forks
35
Avg merge
1d 4h
Merged PRs (30d)
10

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the OpaqueRange explainer and the WHATWG HTML and CSSWG issues linked in the description, then inspect the tentative DOM ranges results at the provided WPT link. Add coverage for OpaqueRange behavior on textarea and input values, and verify that the relevant tests pass across the supported implementations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.