From 10f3c5e67705a013d9fa8cc75bdab28cecc8ec05 Mon Sep 17 00:00:00 2001 From: "jkeiser%netscape.com" Date: Tue, 30 Apr 2002 23:21:58 +0000 Subject: [PATCH] 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 --- .../content/html/content/src/nsHTMLFormElement.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mozilla/content/html/content/src/nsHTMLFormElement.cpp b/mozilla/content/html/content/src/nsHTMLFormElement.cpp index 4f2d61d6957..b8a4507e84a 100644 --- a/mozilla/content/html/content/src/nsHTMLFormElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFormElement.cpp @@ -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);