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

Unified Diff: Source/core/html/HTMLInputElement.cpp

Issue 842153002: Click event should be fired before change events for checkbox and radio button. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/forms/CheckboxInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index b0d4f5783baec227e3c2b911344a79068cebb827..3b4bc38b1558900efb6ba027cdb935b0e7ddb60e 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -897,6 +897,13 @@ bool HTMLInputElement::isTextField() const
return m_inputType->isTextField();
}
+void HTMLInputElement::dispatchChangeEventIfNeeded()
+{
+ setTextAsOfLastFormControlChangeEvent(String());
+ if (inDocument() && m_inputType->shouldSendChangeEventAfterCheckedChanged())
+ dispatchFormControlChangeEvent();
+}
+
void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventBehavior)
{
if (checked() == nowChecked)
@@ -930,7 +937,6 @@ void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
setTextAsOfLastFormControlChangeEvent(String());
if (eventBehavior == DispatchInputAndChangeEvent)
dispatchFormControlInputEvent();
- dispatchFormControlChangeEvent();
}
pseudoStateChanged(CSSSelector::PseudoChecked);
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/forms/CheckboxInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698