Bug 1386471 - Don't remove all ranges before calling SetText(); r=masayuki
☠☠ backed out by 2e16fd389e84 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 01 Aug 2017 21:17:49 -0400
changeset 424531 05400533498bd8e39c397eb67188b1a39b54408f
parent 424530 8fb848f123a8f1b22a61bcbb57a1583f40e64b36
child 424532 3b7a0f88829436f1b82630ebb7cc0f1c8cf04172
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1386471
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1386471 - Don't remove all ranges before calling SetText(); r=masayuki
dom/html/nsTextEditorState.cpp
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2661,22 +2661,16 @@ nsTextEditorState::SetValue(const nsAStr
 
             if (insertValue.IsEmpty()) {
               textEditor->DeleteSelection(nsIEditor::eNone, nsIEditor::eStrip);
             } else {
               textEditor->InsertText(insertValue);
             }
           } else {
             AutoDisableUndo disableUndo(textEditor);
-            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();
-            }
-
             textEditor->SetText(newValue);
           }
 
           mTextListener->SetValueChanged(true);
           mTextListener->SettingValue(false);
 
           if (!notifyValueChanged) {
             // Listener doesn't update frame, but it is required for placeholder