| Index: Source/core/html/forms/TextFieldInputType.cpp
|
| diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
|
| index f10c398f13a65840e1537fcfa0ca51b9cc90be14..0dc18eccefccf52b92702cb47b463c81939e6d5c 100644
|
| --- a/Source/core/html/forms/TextFieldInputType.cpp
|
| +++ b/Source/core/html/forms/TextFieldInputType.cpp
|
| @@ -160,10 +160,14 @@ void TextFieldInputType::setValue(const String& sanitizedValue, bool valueChange
|
| input->updateView();
|
|
|
| unsigned max = visibleValue().length();
|
| - if (input->focused())
|
| - input->setSelectionRange(max, max);
|
| - else
|
| - input->cacheSelectionInResponseToSetValue(max);
|
| + if (input->focused()) {
|
| + if (input->selectionStartForJavascriptBindings() != input->selectionEndForJavascriptBindings())
|
| + input->setSelectionRange(input->selectionStartForJavascriptBindings(), input->selectionEndForJavascriptBindings());
|
| + else
|
| + input->setSelectionRange(max, max);
|
| + } else {
|
| + input->setSelectionRange(input->selectionStartForJavascriptBindings(), input->selectionEndForJavascriptBindings());
|
| + }
|
|
|
| if (!valueChanged)
|
| return;
|
|
|