Bug 1540037 - part 18: Move ReplaceTextAsAction() and ReplaceSelectionAsSubAction() to EditorBase r=m_kato

They are used by setting text value of `TextEditor` or replacing a misspelled
word with a new word in both `TextEditor` and `HTMLEditor`.  Therefore,
they should be in the `EditorBase` rather than `TextEditor`.

Note that the path of the former case may be in a hot path.  Therefore, we need
to keep redirecting to `TextEditor` for keeping the performance only in the
case.

Depends on D115785

Differential Revision: https://phabricator.services.mozilla.com/D115786
This commit is contained in:
Masayuki Nakano
2021-05-25 04:26:14 +00:00
parent c4391829a7
commit 9566ff5659
6 changed files with 169 additions and 160 deletions

View File

@@ -2762,7 +2762,7 @@ bool TextControlState::SetValueWithTextEditor(
: TextEditor::AllowBeforeInputEventCancelable::No,
nullptr);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"TextEditor::ReplaceTextAsAction() failed");
"EditorBase::ReplaceTextAsAction() failed");
return rv != NS_ERROR_OUT_OF_MEMORY;
}