nsXPIDLCString scheme; PRBool isMailto = PR_FALSE; if (actionURL && NS_FAILED(rv = actionURL->SchemeIs("mailto", &isMailto))) { return rv; }  if (isMailto) { PRBool enabled; rv = securityManager->IsCapabilityEnabled("UniversalSendMail", &enabled); NS_ENSURE_SUCCESS(rv, rv);  if (!enabled) {  return NS_ERROR_DOM_SECURITY_ERR; } }
nsHTMLFormElement::GetActionURL(nsIURI** aActionURL){  nsresult rv = NS_OK;  *aActionURL = nsnull;  //  // Grab the URL string  //  nsAutoString action;  GetAction(action);  //  // Form the full action URL  //  // Get the document to form the URL.  // We'll also need it later to get the DOM window when notifying form submit  // observers (bug 33203)  if (!mDocument) {    return NS_OK; // No doc means don't submit, see Bug 28988  }  // Get base URL  nsCOMPtr<nsIURI> docURL;  mDocument->GetBaseURL(*getter_AddRefs(docURL));  NS_ASSERTION(docURL, "No Base URL found in Form Submit!\n");  if (!docURL) {    return NS_OK; // No base URL -> exit early, see Bug 30721  }  // If an action is not specified and we are inside  // a HTML document then reload the URL. This makes us  // compatible with 4.x browsers.  // If we are in some other type of document such as XML or  // XUL, do nothing. This prevents undesirable reloading of  // a document inside XUL.  nsCOMPtr<nsIURI> actionURL;  if (action.IsEmpty()) {    nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(mDocument));    if (!htmlDoc) {      // Must be a XML, XUL or other non-HTML document type      // so do nothing.      return NS_OK;    }    rv = docURL->Clone(getter_AddRefs(actionURL));    NS_ENSURE_SUCCESS(rv, rv);  } else {    rv = NS_NewURI(getter_AddRefs(actionURL), action, nsnull, docURL);    NS_ENSURE_SUCCESS(rv, rv);  }  //  // Verify the URL should be reached  //  // Get security manager, check to see if access to action URI is allowed.  //  // XXX This code has not been tested.  mailto: does not work in forms.  //  nsCOMPtr<nsIScriptSecurityManager> securityManager =    do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);  NS_ENSURE_SUCCESS(rv, rv);  rv = securityManager->CheckLoadURI(docURL, actionURL,                                     nsIScriptSecurityManager::STANDARD);  NS_ENSURE_SUCCESS(rv, rv);  nsXPIDLCString scheme;  PRBool isMailto = PR_FALSE;  if (actionURL && NS_FAILED(rv = actionURL->SchemeIs("mailto", &isMailto))) {    return rv;  }  if (isMailto) {    PRBool enabled;    rv = securityManager->IsCapabilityEnabled("UniversalSendMail", &enabled);    NS_ENSURE_SUCCESS(rv, rv);    if (!enabled) {      // Form submit to a mailto: URI requires UniversalSendMail privilege      return NS_ERROR_DOM_SECURITY_ERR;    }  }  //  // Assign to the output  //  *aActionURL = actionURL;  NS_ADDREF(*aActionURL);  return rv;}