Closed Bug 1639287 Opened 4 years ago Closed 2 years ago

Undoing paragraph deletion incorrectly adds an empty paragraph

Categories

(Core :: DOM: Editor, defect, P3)

x86_64
Windows 10
defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: saschanaz, Assigned: masayuki)

References

Details

Attachments

(4 files, 4 obsolete files)

Attached file paragraph-deletion.html (obsolete) —
  1. Open the attachment
  2. Try deleting in either direction and undoing that action.

Expected: Paragraph should restore
Actual: An empty paragraph appears instead of the original one

Attached file paragraph-deletion.html (obsolete) —
Attachment #9150217 - Attachment is obsolete: true
Attached file paragraph-deletion.html (obsolete) —
Attachment #9150234 - Attachment is obsolete: true
Attached file paragraph-deletion.html (obsolete) —
Attachment #9150237 - Attachment is obsolete: true

Emojis are unexpectedly broken, filed Bug 1639311.

I couldn't reproduce this on Win10, nightly 78.

"Here" is meant to be the right side (or left in the second case) of the emoji, while it's currently broken. Could you try again?

Trying again after Bug 1639311...

Attachment #9150239 - Attachment is obsolete: true
Severity: -- → S3

Still broken; also on Ubuntu.

A preparation patch for bug 1735608 will fix this. I'll post the patch to here soon.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Priority: -- → P3
See Also: 1740656

JoinNodeTransaction::UndoTransaction() has its own splitting code. However,
it has some bugs, it does not handle surrogate pairs correctly and it does not
care selections. HTMLEditor::DoSplitNode() is used for splitting a DOM node
from SplitNodeTransaction::DoTransaction(). So that we should make
JoinNodeTransaction::UndoTransaction() should use HTMLEditor::DoSplitNode()
for saving the maintenance cost.

Depends on D132121

Similarly, SplitNodeTransaction::RedoTransaction() has its own code, but it
does not work well. Let's make it use HTMLEditor::DoSplitNode() instead.

This fixes bug 1740656.

Depends on D132122

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/ccf78c106ecf
Add WPT to check undo/redo behavior r=m_kato
https://hg.mozilla.org/integration/autoland/rev/0b4c7957b844
part 1: Make `JoinNodeTransaction::UndoTransaction()` use `HTMLEditor::DoSplitNode()` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/517f1f870d28
part 2: Make `SplitNodeTransaction::RedoTransaction()` use `HTMLEditor::DoSplitNode()` r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/31773 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-96b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: