Closed Bug 1655389 Opened 6 months ago Closed 6 months ago

Split `HTMLEditor::HandleDeleteCollapsedSelectionAtOtherBlockBoundary()` to range computation part and modifying DOM tree part

Categories

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

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(3 files)

Same as the patch for bug 1655391, this patch splits the method to 2 parts.
One is to consider content nodes to join or a <br> element to delete instead.

Note that this patch changes the behavior a little. That is, when the other
block is not editable, it throws an exception here:
https://searchfox.org/mozilla-central/rev/56bb74ea8e04bdac57c33cbe9b54d889b9262ade/editor/libeditor/HTMLEditSubActionHandler.cpp#3124

But it should just cancel the edit action. Therefore, some tests in
BrowserScope are fixed by this patch. I.e., result of DOM tree in the
situation isn't changed, but stops throwing unnecessary exception.

Depends on D85567

The recursive call is not safe. We should do it more carefully. For now,
we should not hide the recursive call into the leaf handler.

Depends on D85569

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/4e9b12c286f4
part 1: Move `HTMLEditor::HandleDeleteCollapsedSelectionAtCurrentBlockBoundary()` into `AutoBlockElementJoiner` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/1e439a68f0e4
part 2: Move recursive call in `AutoBlockElementsJoiner::HandleDeleteCollapsedSelectionAtCurrentBlockBoundary()` to `HTMLEditor::HandleDeleteAroundCollapsedSelection()` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/de60b2f1987f
part 3: Split the case deleting `<br>` element off from `AutoBlockElementsJoiner::HandleDeleteCollapsedSelectionAtOtherBlockBoundary()` r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.