Index: third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp |
diff --git a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp |
index 1893fdf34a1e6f2d69bbb139de7e8c9d4289462c..8de50a5a91b531a3bdfb464306e843808a6bf67d 100644 |
--- a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp |
+++ b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp |
@@ -148,7 +148,8 @@ bool TextFieldInputType::canSetSuggestedValue() { |
void TextFieldInputType::setValue(const String& sanitizedValue, |
bool valueChanged, |
- TextFieldEventBehavior eventBehavior) { |
+ TextFieldEventBehavior eventBehavior, |
+ TextControlSetValueSelection selection) { |
// We don't use InputType::setValue. TextFieldInputType dispatches events |
// different way from InputType::setValue. |
element().setNonAttributeValue(sanitizedValue); |
@@ -156,8 +157,10 @@ void TextFieldInputType::setValue(const String& sanitizedValue, |
if (valueChanged) |
element().updateView(); |
- unsigned max = visibleValue().length(); |
- element().setSelectionRange(max, max); |
+ if (selection == TextControlSetValueSelection::kSetSelectionToEnd) { |
+ unsigned max = visibleValue().length(); |
+ element().setSelectionRange(max, max); |
+ } |
if (!valueChanged) |
return; |