[wpt-sync] Sync PR 50283 - Add UpdateSelectionBehavior to Range::UpdateSelectionIfAddedToSelection
Categories
(Core :: DOM: Selection, task, P4)
Tracking
()
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/1342This is the proposal (B) discussed here:
https://github.com/whatwg/dom/issues/772#issuecomment-2491887033To do this, we define enum UpdateSelectionIfAddedToSelection to have
three possible update selection behavior:
- kAll, set selection to have the same start and end as range.
--> Default case, when both setStart, setEnd are called.- kStartOnly, set selection to have the same start as range only.
--> When only setStart is called.- 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}
Assignee | ||
Updated•29 days ago
|
Assignee | ||
Comment 1•29 days ago
|
||
Assignee | ||
Comment 2•29 days ago
|
||
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
- /selection/shadow-dom/tentative/Selection-getComposedRanges-range-update.html [wpt.fyi]
- modify getRangeAt() range.:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - modify createRange() range added to selection after setEnd call.:
FAIL
(Chrome:PASS
, Safari:FAIL
) - modify createRange() range added to selection before setStart/setEnd calls.:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
- modify getRangeAt() range.:
Comment 4•25 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/91274894c73c
https://hg.mozilla.org/mozilla-central/rev/01d8c8aa39ae
Description
•