Bug 1357206 part 5. When moving the cursor to the end of text on value set, reset the selection direction as well, per spec. r=ehsan

This commit is contained in:
Boris Zbarsky 2017-05-01 13:33:09 -04:00
Родитель 29d5ae0bfd
Коммит c11223cba0
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -2651,6 +2651,7 @@ nsTextEditorState::SetValue(const nsAString& aValue, uint32_t aFlags)
if (aFlags & eSetValue_MoveCursorToEndIfValueChanged) {
props.SetStart(newValue.Length());
props.SetEnd(newValue.Length());
props.SetDirection(nsITextControlFrame::eForward);
} else {
// Make sure our cached selection position is not outside the new value.
props.SetStart(std::min(props.GetStart(), newValue.Length()));