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

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: Use sanitize value if not null, if null use defaultValue() 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 1d97194ccb36804bb4c08e50ad3ffafbc6f647d7..e3914eceabadc1455095ff39033350eead69aef3 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -839,7 +839,7 @@ String HTMLInputElement::resultForDialogSubmit()
void HTMLInputElement::resetImpl()
{
if (m_inputType->storesValueSeparateFromAttribute()) {
- setValue(String());
+ setValue(String(), DispatchNoEvent);
tkent 2014/11/10 01:54:39 This change is unnecessary.
Habib Virji 2014/11/13 15:00:55 Acknowledged.
setNeedsValidityCheck();
}
@@ -1027,7 +1027,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