Bug 1376856 - Backed out
bug 1370806 part 2 from Firefox 55. r?masayuki
When setting to empty on input.value, previous text node is removed. Then, since we don't set selection to root node, SpellCheckAfterEditorChange might return error. So this issue occur.
Although this issue has been fixed by
bug 1375910, this is risky for beta. So I think that we should back out
bug 1370806 part 2 from beta.
Also, unit test will create and add to m-c after landing this...
MozReview-Commit-ID: 8oATH5AnJFa
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2656,21 +2656,16 @@ nsTextEditorState::SetValue(const nsAStr
if (insertValue.IsEmpty()) {
mEditor->DeleteSelection(nsIEditor::eNone, nsIEditor::eStrip);
} else {
plaintextEditor->InsertText(insertValue);
}
} else {
AutoDisableUndo disableUndo(mEditor);
- if (domSel) {
- // Since we don't use undo transaction, we don't need to store
- // selection state. SetText will set selection to tail.
- domSel->RemoveAllRanges();
- }
plaintextEditor->SetText(newValue);
}
mTextListener->SetValueChanged(true);
mTextListener->SettingValue(false);
}