зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1629474 - Avoid warnings when initializing empty editors. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D70669 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9bfcce4383
Коммит
9e9b510199
|
@ -139,11 +139,18 @@ nsresult TextEditor::Init(Document& aDoc, Element* aRoot,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// We set mInitSucceeded here rather than at the end of the function,
|
||||
// since InitEditorContentAndSelection() can perform some transactions
|
||||
// and can warn if mInitSucceeded is still false.
|
||||
MOZ_ASSERT(!mInitSucceeded, "TextEditor::Init() shouldn't be nested");
|
||||
mInitSucceeded = true;
|
||||
|
||||
rv = InitEditorContentAndSelection();
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("TextEditor::InitEditorContentAndSelection() failed");
|
||||
// XXX Sholdn't we expose `NS_ERROR_EDITOR_DESTROYED` even though this
|
||||
// is a public method?
|
||||
mInitSucceeded = false;
|
||||
return EditorBase::ToGenericNSResult(rv);
|
||||
}
|
||||
|
||||
|
@ -151,8 +158,6 @@ nsresult TextEditor::Init(Document& aDoc, Element* aRoot,
|
|||
// we're initializing the editor.
|
||||
ClearUndoRedo();
|
||||
EnableUndoRedo();
|
||||
MOZ_ASSERT(!mInitSucceeded, "TextEditor::Init() shouldn't be nested");
|
||||
mInitSucceeded = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче