mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
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:
parent
0a20d424de
commit
742748af3a
@ -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.
|
||||
|
@ -1264,7 +1264,7 @@ nsHTMLInputElement::Click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user