Bug 1401225 - Pass the correct length when collapsing the selection in EditorBase::SetTextImpl(); r=masayuki

This commit is contained in:
Ehsan Akhgari 2017-09-19 11:31:28 -04:00
parent 2b16b7ec4c
commit 445bf0b3fc

View File

@ -2746,7 +2746,7 @@ EditorBase::SetTextImpl(Selection& aSelection, const nsAString& aString,
// Only set selection to insertion point if editor gives permission
if (GetShouldTxnSetSelection()) {
RefPtr<Selection> selection = GetSelection();
DebugOnly<nsresult> rv = selection->Collapse(&aCharData, length);
DebugOnly<nsresult> rv = selection->Collapse(&aCharData, aString.Length());
NS_ASSERTION(NS_SUCCEEDED(rv),
"Selection could not be collapsed after insert");
}