Fixes for bug 38269. Fixes crash during page rewrite in focus, reset, submit and location change in onunload. r:mjudge

git-svn-id: svn://10.0.0.236/trunk@70884 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
joki%netscape.com
2000-05-26 00:26:54 +00:00
parent ddcf7b1ef8
commit fab946580d
7 changed files with 82 additions and 105 deletions

View File

@@ -322,22 +322,22 @@ nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
nsIContent *formContent = nsnull;
mFormFrame->GetContent(&formContent);
if (IsReset(type) == PR_TRUE) {
event.message = NS_FORM_RESET;
if (nsnull != formContent) {
formContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
if (IsReset(type) == PR_TRUE) {
event.message = NS_FORM_RESET;
presShell->HandleEventWithTarget(&event, nsnull, formContent, &status);
if (nsEventStatus_eConsumeNoDefault != status && mFormFrame) {
mFormFrame->OnReset(aPresContext);
}
}
if (nsEventStatus_eConsumeNoDefault != status) {
mFormFrame->OnReset(aPresContext);
}
}
else if (IsSubmit(type) == PR_TRUE) {
event.message = NS_FORM_SUBMIT;
if (nsnull != formContent) {
formContent->HandleDOMEvent(aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
}
if (nsEventStatus_eConsumeNoDefault != status) {
mFormFrame->OnSubmit(aPresContext, this);
else if (IsSubmit(type) == PR_TRUE) {
event.message = NS_FORM_SUBMIT;
presShell->HandleEventWithTarget(&event, nsnull, formContent, &status);
if (nsEventStatus_eConsumeNoDefault != status && mFormFrame) {
mFormFrame->OnSubmit(aPresContext, this);
}
}
}