github web-platform-tests/wpt merge_pr_47615

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
13 months ago

[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/c/chromium/src/+/5768258
Reviewed-by: Kent Tamura tkent@chromium.org
Commit-Queue: Sambamurthy Bandaru sambamurthy.bandaru@microsoft.com
Reviewed-by: Siye Liu siliu@microsoft.com
Cr-Commit-Position: refs/heads/main@{#1342273}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.