mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1655706 - part 3-2: Move AutoTransactionsConserveSelection
in HTMLEditor::TryToJoinBlocksWithTransaction()
into each WhiteSpaceVisibilityKeeper
method r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85534
This commit is contained in:
parent
92735646e3
commit
8147272ea7
@ -4485,8 +4485,6 @@ EditActionResult HTMLEditor::TryToJoinBlocksWithTransaction(
|
||||
}
|
||||
}
|
||||
|
||||
AutoTransactionsConserveSelection dontChangeMySelection(*this);
|
||||
|
||||
// If the left block element is in the right block element, move the hard
|
||||
// line including the right block element to end of the left block.
|
||||
// However, if we are merging list elements, we don't join them.
|
||||
|
@ -146,6 +146,8 @@ EditActionResult WhiteSpaceVisibilityKeeper::
|
||||
// - to delete invisible white-spaces before afterRightBlockChild.GetChild()
|
||||
// - to delete invisible `<br>` element at end of aLeftBlockElement
|
||||
|
||||
AutoTransactionsConserveSelection dontChangeMySelection(aHTMLEditor);
|
||||
|
||||
EditorDOMPoint afterRightBlockChild = aAtRightBlockChild.NextPoint();
|
||||
MOZ_ASSERT(afterRightBlockChild.IsSetAndValid());
|
||||
nsresult rv = WhiteSpaceVisibilityKeeper::DeleteInvisibleASCIIWhiteSpaces(
|
||||
@ -269,6 +271,8 @@ EditActionResult WhiteSpaceVisibilityKeeper::
|
||||
// - to delete invisible white-spaces before aAtLeftBlockChild.GetChild()
|
||||
// - to delete invisible `<br>` element before aAtLeftBlockChild.GetChild()
|
||||
|
||||
AutoTransactionsConserveSelection dontChangeMySelection(aHTMLEditor);
|
||||
|
||||
nsresult rv = WhiteSpaceVisibilityKeeper::DeleteInvisibleASCIIWhiteSpaces(
|
||||
aHTMLEditor, EditorDOMPoint(&aRightBlockElement, 0));
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -435,6 +439,8 @@ EditActionResult WhiteSpaceVisibilityKeeper::
|
||||
// - to delete invisible white-spaces at start of aRightBlockElement
|
||||
// - to delete invisible `<br>` element at end of aLeftBlockElement
|
||||
|
||||
AutoTransactionsConserveSelection dontChangeMySelection(aHTMLEditor);
|
||||
|
||||
// Adjust white-space at block boundaries
|
||||
nsresult rv = WhiteSpaceVisibilityKeeper::
|
||||
MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange(
|
||||
|
Loading…
Reference in New Issue
Block a user