Skip to content

[selection api] Rewrite Selection-getComposedRanges-range-update.html#51561

Merged
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-1e8d9999fc
Mar 24, 2025
Merged

[selection api] Rewrite Selection-getComposedRanges-range-update.html#51561
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-1e8d9999fc

Conversation

@chromium-wpt-export-bot
Copy link
Copy Markdown
Collaborator

This change reformat the tentative test
Selection-getComposedRanges-range-update.html to match the spec
at whatwg/dom#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 <dom@chromium.org>
Commit-Queue: Di Zhang <dizhangg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1437019}

This change reformat the tentative test
Selection-getComposedRanges-range-update.html to match the spec
at whatwg/dom#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 <dom@chromium.org>
Commit-Queue: Di Zhang <dizhangg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1437019}
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit a83a40d into master Mar 24, 2025
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-1e8d9999fc branch March 24, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants