diff --git a/content/html/content/src/nsHTMLButtonElement.cpp b/content/html/content/src/nsHTMLButtonElement.cpp
index d707ecd714b..9871ed49235 100644
--- a/content/html/content/src/nsHTMLButtonElement.cpp
+++ b/content/html/content/src/nsHTMLButtonElement.cpp
@@ -520,15 +520,6 @@ nsHTMLButtonElement::HandleDOMEvent(nsIPresContext* aPresContext,
case NS_MOUSE_LEFT_CLICK:
{
if (mForm) {
- if (mType == NS_FORM_BUTTON_SUBMIT) {
- // tell the form to forget a possible pending submission.
- // the reason is that the script returned true (the event was
- // ignored) so if there is a stored submission, it will miss
- // the name/value of the submitting element, thus we need
- // to forget it and the form element will build a new one
- mForm->ForgetPendingSubmission();
- }
-
if (mType == NS_FORM_BUTTON_SUBMIT || mType == NS_FORM_BUTTON_RESET) {
nsFormEvent event;
event.eventStructType = NS_FORM_EVENT;
diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp
index 8ecbe99e381..7b26d5aa710 100644
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -1709,14 +1709,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
{
if (mForm && (oldType == NS_FORM_INPUT_SUBMIT ||
oldType == NS_FORM_INPUT_IMAGE)) {
- if (mType == NS_FORM_INPUT_SUBMIT || mType == NS_FORM_INPUT_IMAGE) {
- // tell the form to forget a possible pending submission.
- // the reason is that the script returned true (the event was
- // ignored) so if there is a stored submission, it will miss
- // the name/value of the submitting element, thus we need
- // to forget it and the form element will build a new one
- mForm->ForgetPendingSubmission();
- } else {
+ if (mType != NS_FORM_INPUT_SUBMIT && mType != NS_FORM_INPUT_IMAGE) {
// If the type has changed to a non-submit type, then we want to
// flush the stored submission if there is one (as if the submit()
// was allowed to succeed)