Bug 1658702 - part 16: Implement `AutoBlockElementsJoiner::ComputeRangesToDeleteContentInRanges()` and `AutoBlockElementsJoiner::ComputeRangesToJoinBlockElementsInSameParent()` r=m_kato

They need to just call
`AutoDeleteRangesHandler::ComputeRangesToDeleteRangesWithTransaction()` because
their corresponding methods calls `EditorBase::DeleteRangesWithTransaction()`
and do additional different jobs after that, but the they don't affect the
ranges.

* https://searchfox.org/mozilla-central/rev/0c97a6410ff018c22e65a0cbe4e5f2ca4581b22e/editor/libeditor/HTMLEditSubActionHandler.cpp#4602,4627-4628,4639-4642
* https://searchfox.org/mozilla-central/rev/0c97a6410ff018c22e65a0cbe4e5f2ca4581b22e/editor/libeditor/HTMLEditSubActionHandler.cpp#4650,4669-4670,4676-4678,4685-4686

Depends on D90212

Differential Revision: https://phabricator.services.mozilla.com/D90213
This commit is contained in:
Masayuki Nakano 2020-09-17 08:39:31 +00:00
Родитель 1492a7168d
Коммит 6551ca6994
1 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -5176,7 +5176,13 @@ nsresult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner::
->GetEndContainer()
->IsInclusiveDescendantOf(mRightContent));
return NS_OK;
nsresult rv =
mDeleteRangesHandlerConst.ComputeRangesToDeleteRangesWithTransaction(
aHTMLEditor, aDirectionAndAmount, aStripWrappers, aRangesToDelete);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"AutoDeleteRangesHandler::"
"ComputeRangesToDeleteRangesWithTransaction() failed");
return rv;
}
EditActionResult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner::
@ -5250,7 +5256,13 @@ nsresult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner::
->IsInclusiveDescendantOf(mRightContent));
MOZ_ASSERT(mLeftContent->GetParentNode() == mRightContent->GetParentNode());
return NS_OK;
nsresult rv =
mDeleteRangesHandlerConst.ComputeRangesToDeleteRangesWithTransaction(
aHTMLEditor, aDirectionAndAmount, aStripWrappers, aRangesToDelete);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"AutoDeleteRangesHandler::"
"ComputeRangesToDeleteRangesWithTransaction() failed");
return rv;
}
EditActionResult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner::