Re: [whatwg/dom] Add OpaqueRange interface (PR #1404)

@stephanieyzhang commented on this pull request.



> @@ -8669,9 +8669,9 @@ be between 0 and the <a>boundary point</a>'s <a for="boundary point">node</a>'s
 <pre class=idl>
 [Exposed=Window]
 interface AbstractRange {
-  readonly attribute Node startContainer;
+  readonly attribute Node? startContainer;
   readonly attribute unsigned long startOffset;

For form controls, they're indices into the value string, even when the range spans multiple nodes. I'm unsure of how this would look for custom elements though.

I've gotten feedback from people testing OpaqueRange on Chromium (e.g. Microsoft Editor SDK) that they rely on the offsets, using `value.substring(range.startOffset, range.endOffset)` in place of `toString()`, and comparing the caret index against the offsets to test inside/outside. Dropping them would require a workaround.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1404#discussion_r3270488190
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1404/review/4324284756@github.com>

Received on Wednesday, 20 May 2026 00:18:48 UTC