mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
Issue #2532 - Align dialog submission triggered by form.submit() with the spec.
Submission in click handler of submit button should not be deferred per https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-dialog See Bug 1719872
This commit is contained in:
@@ -676,16 +676,6 @@ HTMLFormElement::DoSubmit(WidgetEvent* aEvent)
|
||||
|
||||
mSubmitInitiatedFromUserInput = EventStateManager::IsHandlingUserInput();
|
||||
|
||||
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 = submission;
|
||||
// ensure reentrancy
|
||||
mIsSubmitting = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//
|
||||
// perform the submission
|
||||
//
|
||||
@@ -709,6 +699,17 @@ HTMLFormElement::DoSubmit(WidgetEvent* 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 = submission;
|
||||
// ensure reentrancy
|
||||
mIsSubmitting = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return SubmitSubmission(submission);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user