Closed Bug 1913336 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 47615 - [Editing] Fix errors in applying undo after deleting at block boundary

Categories

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

task

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Sambamurthy Bandaru <sambamurthy.bandaru@microsoft.com> wrote:

[Editing] Fix errors in applying undo after deleting at block boundary

When deleting at the boundary of two editable blocks, the second block
gets merged into the first block. Upon undo both blocks should be
restored to their previous states. Firefox and Safari do this
correctly.

In Chromium, this is not happening if the second block has
non-editable nodes. The second block is restored to its previous state
but the first block is still left with non-editable nodes from the
merge.

This is because -
|InsertNodeBeforeCommand| that inserts those nodes into first
block checks the editability of the first block to apply the command.
But when undoing, it checks the editablitiy of inserted node and does
not apply undo since the inserted node is non-editable.

This is not consistent since the node is non-editable during insert and
undo is not modifying the node itself. The command should check the
editability of the same first block from which the inserted node is
to be removed.

Bug: 355485163
Change-Id: Ia9edf952f2dc96f83bd2c1d97c7ff206b844faa9

Reviewed-on: https://chromium-review.googlesource.com/5768258
WPT-Export-Revision: 857e203291e87ef1201dc282ef355ee6d83aadbe

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

Status Summary

Firefox

OK : 1
PASS: 69

Chrome

OK : 1
PASS: 68
FAIL: 1

Safari

OK : 1
PASS: 69

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dc5fdb1592b9 [wpt PR 47615] - [Editing] Fix errors in applying undo after deleting at block boundary, a=testonly
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.