Bug 64702: Fix crash on focus by adding null checks, and make form.submit call onsubmit handlers before submitting. r=rods@netscape.com, sr=jst@netscape.com

git-svn-id: svn://10.0.0.236/trunk@92382 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pollmann%netscape.com
2001-04-16 06:36:45 +00:00
parent f4455d5079
commit 2e99d49588
11 changed files with 102 additions and 284 deletions

View File

@@ -992,27 +992,6 @@ nsFormControlHelper::DoManualSubmitOrReset(nsIPresContext* aPresContext,
}
}
}
// Check status after handling event to make sure we should continue
if (nsEventStatus_eConsumeNoDefault != status) {
// get the form manager interface
nsIFormManager* formMan = nsnull; // weak reference, not refcounted
result = aFormFrame->QueryInterface(NS_GET_IID(nsIFormManager), (void**)&formMan);
if (NS_SUCCEEDED(result) && formMan) {
// now do the Submit or Reset
if (aDoSubmit) {
// Now go back and get the frame for the control's content
// to make sure it is still valid
nsIFrame* controlFrame;
aPresShell->GetPrimaryFrameFor(controlContent, &controlFrame);
if (controlFrame != nsnull) {
formMan->OnSubmit(aPresContext, controlFrame);
}
} else {
formMan->OnReset(aPresContext);
}
}
}
return result;
}