Chromium Code Reviews| 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) |