Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp

Issue 2735633006: INPUT/TEXTAREA elements: Dispatch 'select' event only if text selection is changed. (Closed)
Patch Set: Remove throttling Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/TextFieldInputType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/TextFieldInputType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698