Bug 1719872 - Dialog submission triggered by form.submit() in click handler of submit button should not be deferred; r=smaug
Per https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-dialog, dialog submission won't run https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#planned-navigation and the steps are synchronous. Differential Revision: https://phabricator.services.mozilla.com/D119667
This commit is contained in:
@@ -665,14 +665,6 @@ nsresult HTMLFormElement::DoSubmit(Event* aEvent) {
|
||||
mSubmitPopupState = PopupBlocker::openAbused;
|
||||
}
|
||||
|
||||
if (mDeferSubmission) {
|
||||
// we are in an event handler, JS submitted so we have to
|
||||
// defer this submission. let's remember it and return
|
||||
// without submitting
|
||||
mPendingSubmission = std::move(submission);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//
|
||||
// perform the submission
|
||||
//
|
||||
@@ -695,6 +687,15 @@ nsresult HTMLFormElement::DoSubmit(Event* aEvent) {
|
||||
submission->GetAsDialogSubmission()) {
|
||||
return SubmitDialog(dialogSubmission);
|
||||
}
|
||||
|
||||
if (mDeferSubmission) {
|
||||
// we are in an event handler, JS submitted so we have to
|
||||
// defer this submission. let's remember it and return
|
||||
// without submitting
|
||||
mPendingSubmission = std::move(submission);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return SubmitSubmission(submission.get());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user