Implement OpaqueRange
Categories
(Core :: DOM: Forms, enhancement)
Tracking
()
People
(Reporter: stephanie.zhang, Assigned: jjaschke)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(4 files, 1 obsolete file)
Steps to reproduce:
Filing this as a tracking bug for implementing FormControlRange.
Implement FormControlRange -- a specialized, live AbstractRange subclass for <input>/<textarea> value space. It enables range-based operations in native controls while restricting standard Range mutations to preserve encapsulation. It integrates cleanly with existing selection/editing behavior and closes a long-standing gap.
Explainer: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/FormControlRange/explainer.md
Ongoing WHATWG discussion thread: https://github.com/whatwg/html/issues/11478
Mozilla Standards Link: https://github.com/mozilla/standards-positions/issues/1289
| Reporter | ||
Updated•3 months ago
|
| Reporter | ||
Comment 1•3 months ago
|
||
Updating this bug to reflect the current proposal.
The proposal has evolved from FormControlRange into OpaqueRange. OpaqueRange is a specialized, live AbstractRange subtype whose boundary points reference internal nodes within host-defined elements (for example, <input>/<textarea> today, with a path to custom elements in the future). It enables range-based operations over encapsulated content while avoiding exposure of internal DOM nodes.
The proposal also updates AbstractRange so startContainer/endContainer can be null, allowing OpaqueRange to return null for those getters while Range and StaticRange continue to return nodes.
Updated explainer:
https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/OpaqueRange/explainer.md
Current specification work:
https://github.com/whatwg/dom/pull/1404
https://github.com/whatwg/html/pull/11741
Relevant WHATWG discussion:
https://github.com/whatwg/html/issues/11478
Mozilla standards position issue:
https://github.com/WebKit/standards-positions/issues/541
| Reporter | ||
Comment 2•3 months ago
|
||
Accidentally linked the Webkit standards position issue instead of Mozilla's -- should be https://github.com/mozilla/standards-positions/issues/1289
| Assignee | ||
Comment 3•2 months ago
|
||
Refactor mIsDynamicRange to RangeType enum. Make startContainer/endContainer
nullable via BinaryName split. Add dom.opaque_range.enabled pref.
Updated•2 months ago
|
| Assignee | ||
Comment 4•2 months ago
|
||
Implements OpaqueRange (dom.spec.whatwg.org/#interface-opaquerange) and its
HTML integration. OpaqueRange has two states: "live" (mStart/mEnd on the
anonymous text node) and "offset-only" (display:none / editor not init'd).
Offset tracking reconstructs user edits from beforeinput selection snapshots,
handles programmatic .value= as full replacement, and setRangeText with precise
offsets. Multi-range selections (Ctrl+click) are supported.
| Assignee | ||
Comment 5•2 months ago
|
||
OpaqueRange lives in the text control's UA shadow DOM with its own
nsFrameSelection. Mirror OpaqueRanges into that internal frame selection
for highlight painting, and redirect Add/RemoveHighlightSelectionRange
to the correct frame selection.
| Assignee | ||
Comment 6•2 months ago
|
||
| Assignee | ||
Comment 7•2 months ago
|
||
Updated•1 month ago
|
Description
•