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

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

Issue 2900943002: Clicking a button on disconnected form should not fire submit event. (Closed)
Patch Set: Align with review comments 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/HTMLFormElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
index c7383329660c994d10e0b8fe301908d6b9c3fec5..92c2a5a4215b5958ebc3d1a59c66b4bb6b77f973 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -283,7 +283,8 @@ void HTMLFormElement::PrepareForSubmission(
Event* event,
HTMLFormControlElement* submit_button) {
LocalFrame* frame = GetDocument().GetFrame();
- if (!frame || is_submitting_ || in_user_js_submit_event_)
+ if (!frame || is_submitting_ || in_user_js_submit_event_ ||
+ (submit_button && !submit_button->isConnected()))
tkent 2017/05/23 23:32:52 You don't need to check isConnected() of submit_bu
Shanmuga Pandi 2017/05/24 07:09:54 Done.
return;
if (GetDocument().IsSandboxed(kSandboxForms)) {
« 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