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

Unified Diff: third_party/WebKit/Source/core/html/forms/InputType.cpp

Issue 2435973002: INPUT element: code cleanup around setValue(). (Closed)
Patch Set: Created 4 years, 2 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 44c21d79388e83ad1913661147c93e82c7bfe5f2..48b12bd20519d52ea049b3720739ab7d795df06f 100644
--- a/third_party/WebKit/Source/core/html/forms/InputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -513,7 +513,11 @@ void InputType::dispatchSearchEvent() {}
void InputType::setValue(const String& sanitizedValue,
bool valueChanged,
TextFieldEventBehavior eventBehavior) {
- element().setValueInternal(sanitizedValue, eventBehavior);
+ // This setValue() implementation is used only for ValueMode::kValue except
+ // TextFieldInputType. That is to say, type=color, type=range, and temporal
+ // input types.
+ DCHECK_EQ(valueMode(), ValueMode::kValue);
+ element().setNonAttributeValue(sanitizedValue);
if (!valueChanged)
return;
switch (eventBehavior) {

Powered by Google App Engine
This is Rietveld 408576698