[cssom-view-1] Define OpaqueRange geometry APIs (getClientRects/getBoundingClientRect)#12904
Draft
stephanieyzhang wants to merge 6 commits intow3c:mainfrom
Draft
[cssom-view-1] Define OpaqueRange geometry APIs (getClientRects/getBoundingClientRect)#12904stephanieyzhang wants to merge 6 commits intow3c:mainfrom
stephanieyzhang wants to merge 6 commits intow3c:mainfrom
Conversation
This was referenced Oct 16, 2025
rename to PlainTextRange + tpac changes
stephanieyzhang
commented
Feb 10, 2026
| text:WebDriver BiDi emulated available screen area | ||
| text:WebDriver BiDi emulated total screen area | ||
| spec:dom; type:interface; text:OpaqueRange | ||
| spec:dom; type:dfn; text:opaque range string |
stephanieyzhang
commented
Feb 10, 2026
|
|
||
| This section defines {{OpaqueRange/getClientRects()}} and {{OpaqueRange/getBoundingClientRect()}} for | ||
| {{OpaqueRange}}. These mirror {{Range}}'s {{Range/getClientRects()}} and | ||
| {{Range/getBoundingClientRect()}}, but operate over the selected portion of the opaque range string |
stephanieyzhang
commented
Feb 10, 2026
Author
There was a problem hiding this comment.
incorporate internal node containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpaqueRange is an AbstractRange subtype whose
is opaqueflag is true, causingstartContainerandendContainerto return null. This preserves encapsulation while enabling range-based geometry operations over content in<input>/<textarea>(with a path to custom elements in the future).This change defines
getClientRects()andgetBoundingClientRect()for OpaqueRange, aligning their behavior with Range for layout and rendering queries. It complements the DOM and HTML integrations, ensuring consistent geometry retrieval for editing and highlight use cases.Explainer: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/OpaqueRange/explainer.md
WhatWG discussion: FormControlRange Interface whatwg/html#11478
Corresponding DOM Spec PR: Add OpaqueRange interface whatwg/dom#1404
Corresponding HTML Spec PR: Integrate OpaqueRange hooks into text controls (input/textarea) whatwg/html#11741
WPT tests are written and can be reviewed and commented upon at:
At least two implementers are interested (and none opposed):
Implementation bugs are filed: