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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.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
Index: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
index d38b101b4d987be76e551cae86b8f2c9a5c3a397..457301e7681c4518fc909053adc925568228c312 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -435,12 +435,23 @@ void HTMLTextAreaElement::setValueCommon(const String& newValue,
}
notifyFormStateChanged();
- if (eventBehavior == DispatchNoEvent) {
- setTextAsOfLastFormControlChangeEvent(normalizedValue);
- } else {
- if (eventBehavior == DispatchInputAndChangeEvent)
+ switch (eventBehavior) {
+ case DispatchChangeEvent:
+ dispatchFormControlChangeEvent();
+ break;
+
+ case DispatchInputAndChangeEvent:
dispatchFormControlInputEvent();
- dispatchFormControlChangeEvent();
+ dispatchFormControlChangeEvent();
+ break;
+
+ case DispatchNoEvent:
+ // We need to update textAsOfLastFormControlChangeEvent for |value| IDL
+ // setter without focus because input-assist features use setValue("...",
+ // DispatchChangeEvent) without setting focus.
+ if (!isFocused())
+ setTextAsOfLastFormControlChangeEvent(normalizedValue);
+ break;
}
}

Powered by Google App Engine
This is Rietveld 408576698