Allow form submit with javascript URI to call submit() within the JS function. bug 139798, r=alexsavulov@netscape.com, sr=attinasi@netscape.com

git-svn-id: svn://10.0.0.236/trunk@120352 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jkeiser%netscape.com
2002-04-30 23:21:58 +00:00
parent f6cb646578
commit 10f3c5e677

View File

@@ -723,6 +723,17 @@ nsHTMLFormElement::DoSubmit(nsIPresContext* aPresContext, nsEvent* aEvent)
return NS_OK;
}
// javascript URIs are not really submissions; they just call a function.
// Also, they may synchronously call submit(), and we want them to be able to
// do so while still disallowing other double submissions. (Bug 139798)
// Note that any other URI types that are of equivalent type should also be
// added here.
PRBool schemeIsJavaScript = PR_FALSE;
if (NS_SUCCEEDED(actionURI->SchemeIs("javascript", &schemeIsJavaScript)) &&
schemeIsJavaScript) {
mIsSubmitting = PR_FALSE;
}
nsAutoString target;
rv = GetTarget(target);
NS_ENSURE_SUBMIT_SUCCESS(rv);