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

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

Issue 2467263002: INPUT/TEXTAREA elements: Dispatch 'change' event even if a user-edit value is overwritten by JS (Closed)
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
index 1e28a40a32714934723b01b29f9c36455d7fbaad..74f2edaebf0b374af34aa4598937edc4889b111c 100644
--- a/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp
@@ -179,15 +179,13 @@ void TextFieldInputType::setValue(const String& sanitizedValue,
}
case DispatchNoEvent:
+ // We need to update textAsOfLastFormControlChangeEvent for |value| IDL
+ // setter without focus because input-assist features use setValue("...",
+ // DispatchChangeEvent) without setting focus.
+ if (!element().isFocused())
+ element().setTextAsOfLastFormControlChangeEvent(element().value());
break;
}
-
- // TODO(tkent): Calling setTextAsOfLastFormControlChangeEvent() twice is very
- // suspicious.
- if (!element().isFocused())
- element().setTextAsOfLastFormControlChangeEvent(element().value());
- if (eventBehavior == DispatchNoEvent)
- element().setTextAsOfLastFormControlChangeEvent(element().value());
}
void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event) {
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698