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

Unified Diff: third_party/WebKit/Source/core/html/HTMLButtonElement.cpp

Issue 2900943002: Clicking a button on disconnected form should not fire submit event. (Closed)
Patch Set: Created 3 years, 7 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/HTMLButtonElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp b/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
index e69bab33322cd66a0c1bd5355123fb1551df6561..6db54609990bca88c26588363ecf6653ae01254c 100644
--- a/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
@@ -105,6 +105,9 @@ void HTMLButtonElement::ParseAttribute(
}
void HTMLButtonElement::DefaultEventHandler(Event* event) {
+ if (!isConnected())
tkent 2017/05/23 06:55:26 Here is not a right place to check this. We have a
Shanmuga Pandi 2017/05/23 10:34:04 Done.
+ return;
+
if (event->type() == EventTypeNames::DOMActivate &&
!IsDisabledFormControl()) {
if (Form() && type_ == SUBMIT) {
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-button-element/button-click-submits-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698