Bug 1632724 - part 4: Rename HTMLEditor::DeleteSelectionWithTransaction() r=m_kato

`HTMLEditor::DeleteSelectionWithTransaction()` calls `EditorBase`'s overridden
method and handles `nsIEditor::eStrip` case.  Therefore, we can rename it with
stop calling the `EditorBase::DeleteSelectionWithTransaction()`, and make it
called by `EditorBase::DeleteSelectionWithTransaction()` only when it's
necessary.

Additionally, we can make all internal method callers of editor classes always
set `nsIEditor::eNoStrip` if the instance is `TextEditor`.  This must make
the code easier to understand.

Depends on D72292

Differential Revision: https://phabricator.services.mozilla.com/D72293
This commit is contained in:
Masayuki Nakano
2020-04-27 00:36:10 +00:00
parent edb08e8410
commit a0fa22d622
10 changed files with 161 additions and 105 deletions

View File

@@ -2818,7 +2818,7 @@ bool TextControlState::SetValueWithTextEditor(
// event so that passing nullptr as nsIPrincipal is safe for
// now.
nsresult rv = textEditor->DeleteSelectionAsAction(
nsIEditor::eNone, nsIEditor::eStrip, nullptr);
nsIEditor::eNone, nsIEditor::eNoStrip, nullptr);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"TextEditor::DeleteSelectionAsAction() failed");
return rv != NS_ERROR_OUT_OF_MEMORY;