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

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: Adding changes to rename variable 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 3af938fb073806ab4bd1bf87d9d9a5e249834468..de111e4447d4b8a4fc0f51e54c143eed8911876b 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -67,7 +67,7 @@ HTMLFormElement::HTMLFormElement(Document& document)
, m_hasElementsAssociatedByParser(false)
, m_didFinishParsingChildren(false)
, m_wasUserSubmitted(false)
- , m_isSubmittingOrPreparingForSubmission(false)
+ , m_isSubmitting(false)
, m_shouldSubmit(false)
, m_isInResetFunction(false)
, m_wasDemoted(false)
@@ -284,23 +284,18 @@ bool HTMLFormElement::prepareForSubmission(Event* event)
{
RefPtr<HTMLFormElement> protector(this);
LocalFrame* frame = document().frame();
- if (m_isSubmittingOrPreparingForSubmission || !frame)
- return m_isSubmittingOrPreparingForSubmission;
+ if (m_isSubmitting || !frame)
+ return m_isSubmitting;
- m_isSubmittingOrPreparingForSubmission = true;
m_shouldSubmit = false;
// Interactive validation must be done before dispatching the submit event.
if (!validateInteractively(event)) {
tkent 2014/03/25 01:56:43 Any JavaScript code can run in validateInteractive
harpreet.sk 2014/03/26 09:16:07 According to the scenario which you mentioned if f
tkent 2014/03/27 00:35:30 form.submit() should submit the form even if the f
- m_isSubmittingOrPreparingForSubmission = false;
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;
@@ -337,12 +332,12 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce
if (!view || !frame || !frame->page())
return;
- if (m_isSubmittingOrPreparingForSubmission) {
+ if (m_isSubmitting) {
m_shouldSubmit = true;
return;
}
- m_isSubmittingOrPreparingForSubmission = true;
+ m_isSubmitting = true;
m_wasUserSubmitted = processingUserGesture;
RefPtr<HTMLFormControlElement> firstSuccessfulSubmitButton;
@@ -376,7 +371,7 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce
firstSuccessfulSubmitButton->setActivatedSubmit(false);
m_shouldSubmit = false;
- m_isSubmittingOrPreparingForSubmission = false;
+ m_isSubmitting = 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