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

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: 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/forms/TextFieldInputType.cpp
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index ac8286164d5bd8907342d46aaa65ff04c518e268..cc71552776aa270dc95419603ea6ac9bb8ea7001 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() ? visibleValue() : sanitizedValue);
tkent 2014/11/10 01:54:39 Why is it visibleValue(), instead of defaultValue(
Habib Virji 2014/11/13 15:00:56 As defaultValue() and sanitizedValue both hold nul
tkent 2014/11/14 00:23:56 Using visibleValue() is semantically incorrect. I
Habib Virji 2014/11/24 11:05:32 Done.
}
void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
« Source/core/html/HTMLInputElement.cpp ('K') | « Source/core/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698