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

Unified Diff: third_party/WebKit/Source/core/html/forms/InputType.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
Index: third_party/WebKit/Source/core/html/forms/InputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp
index 6fcf15a5adc8404e150a6c5ff8b3410206667172..26cb203b39ecc44666e9dceeacf452d259bc2d36 100644
--- a/third_party/WebKit/Source/core/html/forms/InputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -523,7 +523,10 @@ void InputType::setValue(const String& sanitizedValue,
// TextFieldInputType. That is to say, type=color, type=range, and temporal
// input types.
DCHECK_EQ(valueMode(), ValueMode::kValue);
- element().setNonAttributeValue(sanitizedValue);
+ if (eventBehavior == DispatchNoEvent)
+ element().setNonAttributeValue(sanitizedValue);
+ else
+ element().setNonAttributeValueByUserEdit(sanitizedValue);
if (!valueChanged)
return;
switch (eventBehavior) {
@@ -535,7 +538,6 @@ void InputType::setValue(const String& sanitizedValue,
element().dispatchFormControlChangeEvent();
break;
case DispatchNoEvent:
- element().setTextAsOfLastFormControlChangeEvent(element().value());
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698