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

Unified Diff: Source/core/html/HTMLInputElement.cpp

Issue 679273004: Set element value to its default value on reset (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as missed updating one review comment Created 6 years, 1 month 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: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index 03a3844148a46536e4d8d60daeb69c47ce9ac77c..502981f2a21b67558f44efb559d1b30007567b46 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -1025,7 +1025,7 @@ void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior);
if (valueChanged && eventBehavior == DispatchNoEvent)
- setTextAsOfLastFormControlChangeEvent(sanitizedValue);
+ setTextAsOfLastFormControlChangeEvent(sanitizedValue.isNull() ? defaultValue() : sanitizedValue);
if (!valueChanged)
return;

Powered by Google App Engine
This is Rietveld 408576698