From 4407af93170450e0c35c0cfb9560fbed3cec7ca5 Mon Sep 17 00:00:00 2001 From: Stephanie Zhang Date: Fri, 20 Feb 2026 14:59:24 -0800 Subject: [PATCH] Add OpaqueRange disconnect() method Implement disconnect() per WHATWG DOM spec PR #1404 [0]. Detaches the range from its element, stopping live offset updates and zeroing offsets. Calling it multiple times is safe and has no additional effect. Adds WPT tests covering disconnect behavior. Automatic disconnection when the element is removed from the tree or changes type will be handled in a follow-up CL. [0] https://github.com/whatwg/dom/pull/1404#discussion_r2794334771 Low-Coverage-Reason: COVERAGE_UNDERREPORTED Bug: 421421332 Change-Id: I6f0bb55d57f1eb1876779faad018a19d23b1d665 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7595177 Reviewed-by: Dan Clark Commit-Queue: Stephanie Zhang Reviewed-by: Ana Sollano Kim Reviewed-by: Mason Freed Cr-Commit-Position: refs/heads/main@{#1588113} --- .../tentative/OpaqueRange-disconnect.html | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 dom/ranges/tentative/OpaqueRange-disconnect.html diff --git a/dom/ranges/tentative/OpaqueRange-disconnect.html b/dom/ranges/tentative/OpaqueRange-disconnect.html new file mode 100644 index 00000000000000..733918df321249 --- /dev/null +++ b/dom/ranges/tentative/OpaqueRange-disconnect.html @@ -0,0 +1,74 @@ + + + + +