Bug 1812696 - Implement FormData constructor submitter parameter r=webidl,smaug

Also improve error messages for current submitter validations

Spec PR: https://github.com/whatwg/xhr/pull/366
WPT PR: https://github.com/web-platform-tests/wpt/pull/37895

Differential Revision: https://phabricator.services.mozilla.com/D167576
This commit is contained in:
Jon Jensen
2023-02-02 12:26:50 +00:00
parent f886a9aae2
commit ceb72d47c4
5 changed files with 35 additions and 20 deletions

View File

@@ -296,7 +296,7 @@ void HTMLFormElement::RequestSubmit(nsGenericHTMLElement* aSubmitter,
// 1.2. If submitter's form owner is not this form element, then throw a
// "NotFoundError" DOMException.
if (fc->GetForm() != this) {
aRv.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
aRv.ThrowNotFoundError("The submitter is not owned by this form.");
return;
}
}