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

Unified Diff: Source/core/html/forms/TextFieldInputType.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
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/TextFieldInputType.cpp
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index 135d7f9c7ca7f25b883b3fc76c6d8bc134747121..d536c93e21492a989ae169a05be0689abebf3085 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -189,7 +189,7 @@ void TextFieldInputType::setValue(const String& sanitizedValue, bool valueChange
}
if (!input->focused())
- input->setTextAsOfLastFormControlChangeEvent(sanitizedValue);
+ input->setTextAsOfLastFormControlChangeEvent(sanitizedValue.isNull() ? input->defaultValue() : sanitizedValue);
}
void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698