Bug 1682706 - Use SelectionBatcher in SetRangeText r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D100705
This commit is contained in:
Kagami Sascha Rosylight
2021-01-04 23:29:36 +00:00
parent 4be0d47303
commit 5230936eed
2 changed files with 14 additions and 0 deletions

View File

@@ -2307,6 +2307,11 @@ void TextControlState::SetRangeText(const nsAString& aReplacement,
selectionEnd = *aSelectionEnd;
}
// Batch selectionchanges from SetValueFromSetRangeText and SetSelectionRange
Selection* selection =
mSelCon ? mSelCon->GetSelection(SelectionType::eNormal) : nullptr;
SelectionBatcher selectionBatcher(selection); // no-op if nullptr
MOZ_ASSERT(aStart <= aEnd);
value.Replace(aStart, aEnd - aStart, aReplacement);
nsresult rv =