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

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

Issue 2796853002: Update text field 'change' event logic to match to Firefox. (Closed)
Patch Set: . Created 3 years, 8 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/MultipleFieldsTemporalInputTypeView.cpp ('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 ac6b7c989636ddca8db2a9b4d04f66aab3288110..5c5695422fd1bcad5c9686a62721234a231b68f1 100644
--- a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
@@ -152,7 +152,10 @@ void TextFieldInputType::setValue(const String& sanitizedValue,
TextControlSetValueSelection selection) {
// We don't use InputType::setValue. TextFieldInputType dispatches events
// different way from InputType::setValue.
- element().setNonAttributeValue(sanitizedValue);
+ if (eventBehavior == DispatchNoEvent)
+ element().setNonAttributeValue(sanitizedValue);
+ else
+ element().setNonAttributeValueByUserEdit(sanitizedValue);
if (valueChanged)
element().updateView();
@@ -183,11 +186,6 @@ void TextFieldInputType::setValue(const String& sanitizedValue,
}
case DispatchNoEvent:
- // We need to update textAsOfLastFormControlChangeEvent for |value| IDL
- // setter without focus because input-assist features use setValue("...",
- // DispatchChangeEvent) without setting focus.
- if (!element().isFocused())
- element().setTextAsOfLastFormControlChangeEvent(element().value());
break;
}
}
@@ -499,7 +497,6 @@ String TextFieldInputType::convertFromVisibleValue(
}
void TextFieldInputType::subtreeHasChanged() {
- element().setChangedSinceLastFormControlChangeEvent(true);
element().setValueFromRenderer(sanitizeUserInputValue(
convertFromVisibleValue(element().innerEditorValue())));
element().updatePlaceholderVisibility();
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698