Bug 1691357 - Add UserCounter and deprecate warnning message for form submission via untrusted submit event; r=smaug,flod

Differential Revision: https://phabricator.services.mozilla.com/D104070
This commit is contained in:
Edgar Chen
2021-02-09 00:35:23 +00:00
parent 7cb0767d2f
commit bc02cc778a
3 changed files with 7 additions and 0 deletions

View File

@@ -578,6 +578,11 @@ nsresult HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
// to forget it and the form element will build a new one
mPendingSubmission = nullptr;
}
if (!aVisitor.mEvent->IsTrusted()) {
// Warning about the form submission is from untrusted event.
OwnerDoc()->WarnOnceAbout(
DeprecatedOperations::eFormSubmissionUntrustedEvent);
}
DoSubmit(aVisitor.mDOMEvent);
break;
}