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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user