Fixing bug 309348. Don't drop pending form submissions when handling click events even if the event handler drevented the default action. r=bryner@brianryner.com, sr=bzbarsky@mit.edu

This commit is contained in:
jst%mozilla.jstenback.com 2005-09-30 22:56:49 +00:00
parent 0a20d424de
commit 742748af3a
2 changed files with 7 additions and 2 deletions

View File

@ -456,9 +456,14 @@ nsHTMLButtonElement::HandleDOMEvent(nsPresContext* aPresContext,
}
} else {
switch (aEvent->message) {
// Make sure any pending submissions from a call to
// form.submit() in a left click handler or an activate
// handler gets flushed, even if the event handler prevented
// the default action.
case NS_MOUSE_LEFT_CLICK:
case NS_UI_ACTIVATE:
if (mForm && mType == NS_FORM_BUTTON_SUBMIT) {
// tell the form to flush a possible pending submission.
// Tell the form to flush a possible pending submission.
// the reason is that the script returned false (the event was
// not ignored) so if there is a stored submission, it needs to
// be submitted immediatelly.

View File

@ -1264,7 +1264,7 @@ nsHTMLInputElement::Click()
}
}
}
return NS_OK;
}