зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1716728 - Part 1: Use IsEmpty() instead of mPaddingBRElementForEmptyEditor existence check r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D118063
This commit is contained in:
Родитель
1cc55fd4cf
Коммит
7851edce6e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1100,9 +1100,7 @@ EditActionResult HTMLEditor::HandleDeleteSelection(
|
|||
// CreateStyleForInsertText()
|
||||
TopLevelEditSubActionDataRef().mDidDeleteSelection = true;
|
||||
|
||||
// If there is only padding `<br>` 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 `<br>` element for empty editor, cancel the
|
||||
// operation.
|
||||
if (aHTMLEditor.mPaddingBRElementForEmptyEditor) {
|
||||
if (aHTMLEditor.IsEmpty()) {
|
||||
return EditActionCanceled();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче