зеркало из https://github.com/mozilla/pjs.git
Fix onclick=form.submit(); onsubmit=return false to submit again (bug 192170), r=alexsavulov@netscape.com, sr=bzbarsky@mit.edu, a=asa
This commit is contained in:
Родитель
863a8d106e
Коммит
e6dd75348e
|
@ -520,15 +520,6 @@ nsHTMLButtonElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
case NS_MOUSE_LEFT_CLICK:
|
||||
{
|
||||
if (mForm) {
|
||||
if (mType == NS_FORM_BUTTON_SUBMIT) {
|
||||
// tell the form to forget a possible pending submission.
|
||||
// the reason is that the script returned true (the event was
|
||||
// ignored) so if there is a stored submission, it will miss
|
||||
// the name/value of the submitting element, thus we need
|
||||
// to forget it and the form element will build a new one
|
||||
mForm->ForgetPendingSubmission();
|
||||
}
|
||||
|
||||
if (mType == NS_FORM_BUTTON_SUBMIT || mType == NS_FORM_BUTTON_RESET) {
|
||||
nsFormEvent event;
|
||||
event.eventStructType = NS_FORM_EVENT;
|
||||
|
|
|
@ -1709,14 +1709,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
{
|
||||
if (mForm && (oldType == NS_FORM_INPUT_SUBMIT ||
|
||||
oldType == NS_FORM_INPUT_IMAGE)) {
|
||||
if (mType == NS_FORM_INPUT_SUBMIT || mType == NS_FORM_INPUT_IMAGE) {
|
||||
// tell the form to forget a possible pending submission.
|
||||
// the reason is that the script returned true (the event was
|
||||
// ignored) so if there is a stored submission, it will miss
|
||||
// the name/value of the submitting element, thus we need
|
||||
// to forget it and the form element will build a new one
|
||||
mForm->ForgetPendingSubmission();
|
||||
} else {
|
||||
if (mType != NS_FORM_INPUT_SUBMIT && mType != NS_FORM_INPUT_IMAGE) {
|
||||
// If the type has changed to a non-submit type, then we want to
|
||||
// flush the stored submission if there is one (as if the submit()
|
||||
// was allowed to succeed)
|
||||
|
|
Загрузка…
Ссылка в новой задаче