Bug 1287989. Don't try to do validation or fire submit events in iframes that are sandboxed without allow-forms. r=smaug

This commit is contained in:
Boris Zbarsky
2016-08-02 11:05:36 -07:00
parent da483b1bf9
commit 3c930fe67b
7 changed files with 101 additions and 20 deletions

View File

@@ -381,11 +381,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// Using presShell to dispatch the event. It makes sure that
// event is not handled if the window is being destroyed.
if (presShell && (event.mMessage != eFormSubmit ||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
// We know the element is a submit control, if this check is moved,
// make sure formnovalidate is used only if it's a submit control.
HasAttr(kNameSpaceID_None, nsGkAtoms::formnovalidate) ||
mForm->CheckValidFormSubmission())) {
mForm->SubmissionCanProceed(this))) {
// TODO: removing this code and have the submit event sent by the form
// see bug 592124.
// Hold a strong ref while dispatching