[cssom-view-1] Add PlainTextRange geometry APIs (getClientRects/getBoundingClientRects) #12904
+52
−0
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.
PlainTextRangeis a specialized, liveAbstractRangesubclass representing selection and caret positions within the value space of<input>/<textarea>and other elements whose specifications define that they support plain text ranges. It enables range-based geometry operations for those elements while preserving encapsulation by disallowing directRangemutations.This change adds
getClientRects()andgetBoundingClientRect()methods to thePlainTextRangeinterface, aligning its behavior withRangefor layout and rendering queries. It complements the DOM and HTML integrations ofPlainTextRange, ensuring consistent geometry retrieval across editing and selection APIs.Explainer: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/FormControlRange/explainer.md
WhatWG discussion: FormControlRange Interface whatwg/html#11478
Corresponding DOM Spec PR: Add PlainTextRange interface whatwg/dom#1404
Corresponding HTML Spec PR: Integrate PlainTextRange 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:
Current built changes: Overview.html