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

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

Issue 224963005: Refactoring: Removing variable m_shouldSubmit from HTMLFormElement.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changing return type of HTMLFormElement::prepareForSubmission from bool to void Created 6 years, 8 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 0025c64b8cc6a13ad438fdc45e040f2378e4ae41..1b46df095d210d0647259df2c00942422944d595 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_shouldSubmit(false)
, m_isInResetFunction(false)
, m_wasDemoted(false)
, m_requestAutocompleteTimer(this, &HTMLFormElement::requestAutocompleteTimerFired)
@@ -280,28 +279,21 @@ bool HTMLFormElement::validateInteractively(Event* event)
return false;
}
-bool HTMLFormElement::prepareForSubmission(Event* event)
+void HTMLFormElement::prepareForSubmission(Event* event)
{
RefPtr<HTMLFormElement> protector(this);
LocalFrame* frame = document().frame();
if (!frame)
- return false;
-
- m_shouldSubmit = false;
+ return;
// Interactive validation must be done before dispatching the submit event.
if (!validateInteractively(event))
- return false;
+ return;
frame->loader().client()->dispatchWillSendSubmitEvent(this);
if (dispatchEvent(Event::createCancelableBubble(EventTypeNames::submit)))
- m_shouldSubmit = true;
-
- if (m_shouldSubmit)
submit(event, true, true, NotSubmittedByJavaScript);
-
- return m_shouldSubmit;
}
void HTMLFormElement::submit()
@@ -362,8 +354,6 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
-
- m_shouldSubmit = 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