Skip to content

Integrate OpaqueRange hooks into text controls (input/textarea)#11741

Open
stephanieyzhang wants to merge 21 commits into
whatwg:mainfrom
stephanieyzhang:stzhang-addfcr
Open

Integrate OpaqueRange hooks into text controls (input/textarea)#11741
stephanieyzhang wants to merge 21 commits into
whatwg:mainfrom
stephanieyzhang:stzhang-addfcr

Conversation

@stephanieyzhang

@stephanieyzhang stephanieyzhang commented Oct 2, 2025

Copy link
Copy Markdown

OpaqueRange is a specialized, live AbstractRange subtype whose boundary points reference internal nodes within host-defined elements (e.g., <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.

(See WHATWG Working Mode: Changes for more details.)


/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/infrastructure.html ( diff )
/input.html ( diff )

@stephanieyzhang stephanieyzhang changed the title Add FormControlRange hooks [DO NOT REVIEW] FormControlRange hooks Oct 2, 2025
@stephanieyzhang stephanieyzhang changed the title [DO NOT REVIEW] FormControlRange hooks Integrate FormControlRange hooks into text controls (input/textarea) Oct 9, 2025
@stephanieyzhang stephanieyzhang changed the title Integrate FormControlRange hooks into text controls (input/textarea) Integrate PlainTextRange hooks into text controls (input/textarea) Dec 4, 2025
@stephanieyzhang stephanieyzhang changed the title Integrate PlainTextRange hooks into text controls (input/textarea) Integrate OpaqueRange hooks into text controls (input/textarea) Jan 14, 2026

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is "supports opaque ranges" defined?

Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
@stephanieyzhang

Copy link
Copy Markdown
Author

Where is "supports opaque ranges" defined?

Whoops, forgot to define that 🤦. Added it to the "APIs for the text control selections" section. Let me know if you'd prefer it placed elsewhere as I wasn't sure where the best spot for it was.

Comment thread source Outdated
Comment thread source Outdated
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 26, 2026
The new name makes it explicitly clear that a new range is created each
time, as suggested in HTML spec PR discussion:
whatwg/html#11741 (comment)

Updates the OpaqueRangeCreation mixin and IDL, all implementing classes
(TextControlElement, HTMLInputElement), and test files.

Low-Coverage-Reason: COVERAGE_UNDERREPORTED
Bug: 421421332
Change-Id: Iec9572c470443e85d2a38ecd978bd7c78e8c5a86
beckysiegel pushed a commit to chromium/chromium that referenced this pull request Feb 26, 2026
The new name makes it explicitly clear that a new range is created each
time, as suggested in HTML spec PR discussion:
whatwg/html#11741 (comment)

Updates the OpaqueRangeCreation mixin and IDL, all implementing classes
(TextControlElement, HTMLInputElement), and test files.

Low-Coverage-Reason: COVERAGE_UNDERREPORTED
Bug: 421421332
Change-Id: Iec9572c470443e85d2a38ecd978bd7c78e8c5a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7595653
Reviewed-by: Dan Clark <daniec@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1591036}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 26, 2026
The new name makes it explicitly clear that a new range is created each
time, as suggested in HTML spec PR discussion:
whatwg/html#11741 (comment)

Updates the OpaqueRangeCreation mixin and IDL, all implementing classes
(TextControlElement, HTMLInputElement), and test files.

Low-Coverage-Reason: COVERAGE_UNDERREPORTED
Bug: 421421332
Change-Id: Iec9572c470443e85d2a38ecd978bd7c78e8c5a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7595653
Reviewed-by: Dan Clark <daniec@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1591036}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 26, 2026
The new name makes it explicitly clear that a new range is created each
time, as suggested in HTML spec PR discussion:
whatwg/html#11741 (comment)

Updates the OpaqueRangeCreation mixin and IDL, all implementing classes
(TextControlElement, HTMLInputElement), and test files.

Low-Coverage-Reason: COVERAGE_UNDERREPORTED
Bug: 421421332
Change-Id: Iec9572c470443e85d2a38ecd978bd7c78e8c5a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7595653
Reviewed-by: Dan Clark <daniec@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1591036}
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Mar 4, 2026
…eateValueRange(), a=testonly

Automatic update from web-platform-tests
Rename OpaqueRange getValueRange() to createValueRange()

The new name makes it explicitly clear that a new range is created each
time, as suggested in HTML spec PR discussion:
whatwg/html#11741 (comment)

Updates the OpaqueRangeCreation mixin and IDL, all implementing classes
(TextControlElement, HTMLInputElement), and test files.

Low-Coverage-Reason: COVERAGE_UNDERREPORTED
Bug: 421421332
Change-Id: Iec9572c470443e85d2a38ecd978bd7c78e8c5a86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7595653
Reviewed-by: Dan Clark <daniec@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1591036}

--

wpt-commits: 4c5d702b40927803c1024376687a6ca84e877720
wpt-pr: 58079
@stephanieyzhang stephanieyzhang marked this pull request as ready for review April 23, 2026 15:57
Comment thread source Outdated
Comment thread source Outdated
Comment thread source
Comment thread source Outdated
Comment thread source Outdated
Comment thread source
Comment thread source
@jnjaeschke

jnjaeschke commented May 6, 2026

Copy link
Copy Markdown

What is supposed to happen to OpaqueRanges when the text control element becomes display: none? Should the ranges survive a display:none roundtrip, or are they disconnected?
And does creating a range (createValueRange()) on a display:none element even make sense?

@annevk

annevk commented May 6, 2026

Copy link
Copy Markdown
Member

I think display: none shouldn't impact a range? No other range is impacted by styling, why would this one be?

@jnjaeschke

Copy link
Copy Markdown

(speaking with an implementers hat on) it has implications to implementations if the frame gets destroyed (and re-created), if destroying the frame implicitly destroys the internal text node that is referred to in the opaque range.
My interpretation would be that it's implicitly expected that the range survives, but I wonder if this should be written somewhere explicitly.

@annevk

annevk commented May 8, 2026

Copy link
Copy Markdown
Member

I see. I think we should make sure that the specification doesn't have such assumptions anywhere and then just add explicit test coverage.

@stephanieyzhang

Copy link
Copy Markdown
Author

Good call on display:none. Will add WPT coverage for it.

brave-builds pushed a commit to brave/chromium that referenced this pull request May 27, 2026
Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1636570}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request May 27, 2026
Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1636570}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request May 27, 2026
Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1636570}
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 29, 2026
…e, a=testonly

Automatic update from web-platform-tests
Add OpaqueRange display:none WPT coverage

Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollan@microsoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1636570}

--

wpt-commits: c31c686d5e2abb4b21f8314572f00c277eae6a1b
wpt-pr: 60192
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jun 1, 2026
…e, a=testonly

Automatic update from web-platform-tests
Add OpaqueRange display:none WPT coverage

Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollanmicrosoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhangmicrosoft.com>
Cr-Commit-Position: refs/heads/main{#1636570}

--

wpt-commits: c31c686d5e2abb4b21f8314572f00c277eae6a1b
wpt-pr: 60192

UltraBlame original commit: 1b4462ad416012a97836d1bbd88a8bde1b092e2c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jun 1, 2026
…e, a=testonly

Automatic update from web-platform-tests
Add OpaqueRange display:none WPT coverage

Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollanmicrosoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhangmicrosoft.com>
Cr-Commit-Position: refs/heads/main{#1636570}

--

wpt-commits: c31c686d5e2abb4b21f8314572f00c277eae6a1b
wpt-pr: 60192

UltraBlame original commit: 1b4462ad416012a97836d1bbd88a8bde1b092e2c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jun 1, 2026
…e, a=testonly

Automatic update from web-platform-tests
Add OpaqueRange display:none WPT coverage

Ensures OpaqueRanges survive display:none (frame destruction) and that
programmatic updates still adjust offsets while hidden.

Discussion: whatwg/html#11741

Bug: 421421332
Change-Id: Ie554827f61a7c71d23e14f2efe773297a2474d26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865322
Reviewed-by: Ana Sollano Kim <ansollanmicrosoft.com>
Commit-Queue: Stephanie Zhang <stephanie.zhangmicrosoft.com>
Cr-Commit-Position: refs/heads/main{#1636570}

--

wpt-commits: c31c686d5e2abb4b21f8314572f00c277eae6a1b
wpt-pr: 60192

UltraBlame original commit: 1b4462ad416012a97836d1bbd88a8bde1b092e2c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

OpaqueRange Interface

6 participants