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

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

Issue 199633017: Blink doesnt respect the form.submit() when called on "focus" event for invalid form (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed unnecessary lines from Layout Test Created 6 years, 9 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/HTMLFormElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormElement.cpp
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index 806610fefecc0bc07bca1908c800eaff85e547df..5f8a991471986593e230072064bc33d3bf3017d2 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -66,7 +66,6 @@ HTMLFormElement::HTMLFormElement(Document& document)
, m_hasElementsAssociatedByParser(false)
, m_didFinishParsingChildren(false)
, m_wasUserSubmitted(false)
- , m_isSubmittingOrPreparingForSubmission(false)
, m_shouldSubmit(false)
, m_isInResetFunction(false)
, m_wasDemoted(false)
@@ -283,23 +282,17 @@ bool HTMLFormElement::prepareForSubmission(Event* event)
{
RefPtr<HTMLFormElement> protector(this);
LocalFrame* frame = document().frame();
- if (m_isSubmittingOrPreparingForSubmission || !frame)
- return m_isSubmittingOrPreparingForSubmission;
+ if (!frame)
+ return false;
- m_isSubmittingOrPreparingForSubmission = true;
m_shouldSubmit = false;
// Interactive validation must be done before dispatching the submit event.
- if (!validateInteractively(event)) {
- m_isSubmittingOrPreparingForSubmission = false;
+ if (!validateInteractively(event))
return false;
- }
frame->loader().client()->dispatchWillSendSubmitEvent(this);
- // Set flag before submission as dispatchEvent could trigger another event
- m_isSubmittingOrPreparingForSubmission = false;
-
if (dispatchEvent(Event::createCancelableBubble(EventTypeNames::submit)))
m_shouldSubmit = true;
@@ -336,12 +329,6 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce
if (!view || !frame || !frame->page())
return;
- if (m_isSubmittingOrPreparingForSubmission) {
- m_shouldSubmit = true;
- return;
- }
-
- m_isSubmittingOrPreparingForSubmission = true;
m_wasUserSubmitted = processingUserGesture;
RefPtr<HTMLFormControlElement> firstSuccessfulSubmitButton;
@@ -375,7 +362,6 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce
firstSuccessfulSubmitButton->setActivatedSubmit(false);
m_shouldSubmit = false;
- m_isSubmittingOrPreparingForSubmission = false;
}
void HTMLFormElement::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
« no previous file with comments | « Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698