From 304d1da14be7550c59f0dada7555fa32d059cf97 Mon Sep 17 00:00:00 2001 From: Di Zhang Date: Mon, 24 Mar 2025 12:46:55 -0700 Subject: [PATCH] [selection api] Rewrite Selection-getComposedRanges-range-update.html This change reformat the tentative test Selection-getComposedRanges-range-update.html to match the spec at https://github.com/whatwg/dom/pull/1342: 1. If selection is across different roots, getRangeAt(0) should throw INDEX_SIZE_ERR. 2. If a live range sets its end/start to a disconnected node, the live range and the selection are both collapsed. 3. If a live range sets its end/start to cross a shadow boundary such that the range has start before end, collapse the live range, but not the composed selection range. 4. If a live range sets its end/start to cross a shadow boundary such that the range has start after end, collapse both the live range and the composed selection range. We also clean up the other range API tests: selectNode(), collapse, createRange(), addRange(). Change-Id: I03f9309be67b21a781c47d555732a3480322097b Bug: 40286116 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6383722 Reviewed-by: Dominic Farolino Commit-Queue: Di Zhang Cr-Commit-Position: refs/heads/main@{#1437019} --- ...ection-getComposedRanges-range-update.html | 227 +++++++++++++----- 1 file changed, 161 insertions(+), 66 deletions(-) diff --git a/selection/shadow-dom/tentative/Selection-getComposedRanges-range-update.html b/selection/shadow-dom/tentative/Selection-getComposedRanges-range-update.html index 15f07305b0dfd5..2e54b328f02bba 100644 --- a/selection/shadow-dom/tentative/Selection-getComposedRanges-range-update.html +++ b/selection/shadow-dom/tentative/Selection-getComposedRanges-range-update.html @@ -1,7 +1,7 @@ - + @@ -17,6 +17,7 @@ +
End outside shadow DOM