Bug 1376856 - Backed out bug 1370806 part 2 from Firefox 55. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 04 Jul 2017 16:07:45 +0900
changeset 603704 ff1f99df917bee42b620003e5a60899d329fa3fb
parent 603703 d553313466297741d50c810b95bd9685524dd461
child 635970 13e4629de0356877c963892657bc26b948faa112
push id66829
push userbmo:m_kato@ga2.so-net.ne.jp
push dateTue, 04 Jul 2017 09:55:15 +0000
reviewersmasayuki
bugs1376856, 1370806, 1375910
milestone55.0
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
dom/html/nsTextEditorState.cpp
--- 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);
         }