`WhiteSpaceVisibilityKeepers::DeleteContentNodeAndJoinTextNodesAroundIt()` may not suggest caret position
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox119 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
It's called when deleting invisible <br> element, then, if it does not suggest valid caret position, it stops handling the deletion. The method returns the result of WhiteSpaceVisibilityKeeper::MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange(). However, it may not suggest caret position if it does not touch the DOM tree, e.g., when the caret point is surrounded by <img>s because it does not take the default caret position. Therefore, DeleteContentNodeAndJoinTextNodesAroundIt() should return default caret position instead if MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange() does not suggest caret position.
| Assignee | ||
Comment 1•3 years ago
|
||
It returns the result of
MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange(), but it suggests
caret position only when it modifies the DOM tree since it does not take the
default caret position.
So, DeleteContentNodeAndJoinTextNodesAroundIt() does need to return
aCaretPoint with tracking it during DOM mutations if
MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange() does not
suggest caret point.
I found this bug when I was trying to fix the unexpected failing of
forward delete at end of the last block in the editing host (bug 1850666)
because changing the error handling anyway cause another error at this line.
https://searchfox.org/mozilla-central/rev/bdd5b85b56885cd48bd91d262647e0d3499b3a27/editor/libeditor/HTMLEditorDeleteHandler.cpp#1652
Therefore, without fixing bug 1850666, I have no idea how to check this fix.
Comment 3•3 years ago
|
||
| bugherder | ||
Description
•