Closed Bug 1943714 Opened 29 days ago Closed 25 days ago

[wpt-sync] Sync PR 50283 - Add UpdateSelectionBehavior to Range::UpdateSelectionIfAddedToSelection

Categories

(Core :: DOM: Selection, task, P4)

task

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Di Zhang <dizhangg@chromium.org> wrote:

Add UpdateSelectionBehavior to Range::UpdateSelectionIfAddedToSelection

When a live range attached to a document is modified, this change is
upstreamed to the FrameSelection. New spec [1] says to only update
the composed live range (frame selection)'s start position if setStart
is called and only update end position if setEnd is called:
https://github.com/whatwg/dom/pull/1342

This is the proposal (B) discussed here:
https://github.com/whatwg/dom/issues/772#issuecomment-2491887033

To do this, we define enum UpdateSelectionIfAddedToSelection to have
three possible update selection behavior:

  1. kAll, set selection to have the same start and end as range.
    --> Default case, when both setStart, setEnd are called.
  2. kStartOnly, set selection to have the same start as range only.
    --> When only setStart is called.
  3. kEndOnly, set selection to have the same end as range only.
    --> When only setEnd is called.

We add a WPT test for this new behavior, which only affects the output
of getComposedRanges() as it is the only API that accesses the frame
selection's endpoints directly.

Change-Id: I51ea53fe6156164ba3fbe38b14bc47ff502633b1
Bug: 40286116
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6188157
Reviewed-by: Siye Liu \<siliu@microsoft.com>
Commit-Queue: Di Zhang \<dizhangg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411209}

Component: web-platform-tests → DOM: Selection
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 3 subtests

Status Summary

Firefox

OK : 1
FAIL: 3

Chrome

OK : 1
PASS: 1
FAIL: 2

Safari

OK : 1
FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/91274894c73c [wpt PR 50283] - Add UpdateSelectionBehavior to Range::UpdateSelectionIfAddedToSelection, a=testonly https://hg.mozilla.org/integration/autoland/rev/01d8c8aa39ae [wpt PR 50283] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 25 days ago
: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.