Bug 1765018 - part 7: Make some methods which return an instance (not reference) of EditorDOMPointBase be template methods r=m_kato

For avoiding to use `To<EditorDOMPoint>()` etc from temporary object, such
methods should be templated.

Differential Revision: https://phabricator.services.mozilla.com/D143884
This commit is contained in:
Masayuki Nakano
2022-04-20 23:58:04 +00:00
parent 644601775f
commit 54bb966fad
12 changed files with 357 additions and 270 deletions

View File

@@ -463,7 +463,8 @@ HTMLEditor::HTMLWithContextInserter::GetNewCaretPointAfterInsertingHTML(
wsRunScannerAtStartReason.ScanPreviousVisibleNodeOrBlockBoundaryFrom(
pointToPutCaret);
if (backwardScanFromPointToCaretResult.InVisibleOrCollapsibleCharacters()) {
pointToPutCaret = backwardScanFromPointToCaretResult.Point();
pointToPutCaret =
backwardScanFromPointToCaretResult.Point<EditorDOMPoint>();
} else if (backwardScanFromPointToCaretResult.ReachedSpecialContent()) {
// XXX In my understanding, this is odd. The end reason may not be
// same as the reached special content because the equality is