Bug 389988 - showModalDialog should not throw when blocked by the popup blocker (should return null instead). r+sr=jst, a=mconnor over IRC

This commit is contained in:
jwalden@mit.edu 2007-07-29 21:59:17 -07:00
parent 113e9f840b
commit b6ec5fdf20

View File

@ -5234,8 +5234,9 @@ nsGlobalWindow::ShowModalDialog(const nsAString& aURI, nsIVariant *aArgs,
const nsAString& aOptions,
nsIVariant **aRetVal)
{
nsCOMPtr<nsIDOMWindow> dlgWin;
*aRetVal = nsnull;
nsCOMPtr<nsIDOMWindow> dlgWin;
nsAutoString options(NS_LITERAL_STRING("modal=1,status=1"));
nsAutoString dialogOptions(aOptions);
@ -5243,7 +5244,6 @@ nsGlobalWindow::ShowModalDialog(const nsAString& aURI, nsIVariant *aArgs,
options.AppendLiteral(",scrollbars=1,centerscreen=1,resizable=0");
nsresult rv = OpenInternal(aURI, EmptyString(), options,
PR_FALSE, // aDialog
PR_TRUE, // aCalledNoScript
@ -5252,7 +5252,8 @@ nsGlobalWindow::ShowModalDialog(const nsAString& aURI, nsIVariant *aArgs,
GetPrincipal(), // aCalleePrincipal
nsnull, // aJSCallerContext
getter_AddRefs(dlgWin));
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv))
return NS_OK;
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(dlgWin));