diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index 91c377adce7e..f501d1642c4d 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -1510,7 +1510,7 @@ nsresult EditorBase::ComputeValueInternal(const nsAString& aFormatType, !(aDocumentEncoderFlags & (nsIDocumentEncoder::OutputSelectionOnly | nsIDocumentEncoder::OutputWrap))) { // Shortcut for empty editor case. - if (mPaddingBRElementForEmptyEditor) { + if (IsEmpty()) { aOutputString.Truncate(); return NS_OK; } diff --git a/editor/libeditor/HTMLEditorDeleteHandler.cpp b/editor/libeditor/HTMLEditorDeleteHandler.cpp index 8b88550ae17f..7fe155fd675e 100644 --- a/editor/libeditor/HTMLEditorDeleteHandler.cpp +++ b/editor/libeditor/HTMLEditorDeleteHandler.cpp @@ -1100,9 +1100,7 @@ EditActionResult HTMLEditor::HandleDeleteSelection( // CreateStyleForInsertText() TopLevelEditSubActionDataRef().mDidDeleteSelection = true; - // If there is only padding `
` element for empty editor, cancel the - // operation. - if (mPaddingBRElementForEmptyEditor) { + if (IsEmpty()) { return EditActionCanceled(); } @@ -1400,9 +1398,7 @@ EditActionResult HTMLEditor::AutoDeleteRangesHandler::Run( mOriginalDirectionAndAmount = aDirectionAndAmount; mOriginalStripWrappers = aStripWrappers; - // If there is only padding `
` element for empty editor, cancel the - // operation. - if (aHTMLEditor.mPaddingBRElementForEmptyEditor) { + if (aHTMLEditor.IsEmpty()) { return EditActionCanceled(); }