Closed Bug 1928066 Opened 6 days ago Closed 5 days ago

[wpt-sync] Sync PR 48883 - DOM: Preserve selection during moveBefore()

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 48883 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/48883
Details from upstream follow.

Dominic Farolino <dom@chromium.org> wrote:

DOM: Preserve selection during moveBefore()

This CL preserves visual selection computation when a child is removed
from the DOM during a state-preserving atomic move.

This is particularly relevant when the moved node is either the anchor
or focus node of the selection. This CL also adds a bunch of tests to
confirm that selection is properly preserved when:

  • Selection anchor is moved in the DOM to include more nodes
  • Selection focus is moved in the DOM to exclude once-intersecting
    nodes
  • Nodes that are entirely within a selection (not anchor or focus) are
    rearranged/moved still within that selection

R=nrosenthal@chromium.org

Bug: 40150299
Change-Id: Ib4a4cc8531f954d9864bd62399b297b5c8aa870b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961984
Commit-Queue: Dominic Farolino \<dom@chromium.org>
Reviewed-by: Noam Rosenthal \<nrosenthal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375807}

PR 48883 applied with additional changes from upstream: 4557743c7dc20f3ef9f042e575d89e72dd330a93
Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 6 subtests

Status Summary

Firefox

OK : 1
FAIL: 6

Chrome

OK : 1
FAIL: 6

Safari

OK : 1
FAIL: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /dom/nodes/moveBefore/tentative/selection-preserve.html [wpt.fyi]
    • moveBefore should not reset selection with preceding text: FAIL (Chrome: FAIL, Safari: FAIL)
    • moveBefore should not reset selection with preceding and following text: FAIL (Chrome: FAIL, Safari: FAIL)
    • moveBefore should not reset selection that enters a subtree, when the whole selection is moved: FAIL (Chrome: FAIL, Safari: FAIL)
    • moveBefore anchor node moved up to expand selection and absorb nodes: FAIL (Chrome: FAIL, Safari: FAIL)
    • moveBefore move intersecting nodes out of a selection: FAIL (Chrome: FAIL, Safari: FAIL)
    • moveBefore focus node moved up to shrink selection and exclude nodes: FAIL (Chrome: FAIL, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/34f7bebb5f72 [wpt PR 48883] - DOM: Preserve selection during moveBefore(), a=testonly https://hg.mozilla.org/integration/autoland/rev/7a78e50c8a2a [wpt PR 48883] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.