From 6ee1a148db2913353f53e7ca2c0bf1bdfca4883d Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Tue, 27 Mar 2001 23:19:12 +0000 Subject: [PATCH] sigh. allow dependent windows without parents because the Mozilla code will try to do that git-svn-id: svn://10.0.0.236/trunk@90573 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/bootstrap/nsWindowCreator.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mozilla/xpfe/bootstrap/nsWindowCreator.cpp b/mozilla/xpfe/bootstrap/nsWindowCreator.cpp index 8e08fba55ab..43720c63041 100644 --- a/mozilla/xpfe/bootstrap/nsWindowCreator.cpp +++ b/mozilla/xpfe/bootstrap/nsWindowCreator.cpp @@ -83,9 +83,16 @@ nsWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent, convention suggests this method only be used when there is no parent window (otherwise, just call Open() on the parent). However, we should say something, just to be sure: */ - if (aParent || (aChromeFlags & nsIWebBrowserChrome::CHROME_DEPENDENT)) + NS_ASSERTION(!aParent, "window creator reached with non-null parent"); + if (aParent) return NS_ERROR_INVALID_ARG; + /* And you really shouldn't be making dependent windows without a parent. + But unparented modal (and therefore dependent) windows happen + in our codebase, so we allow it after some bellyaching: */ + if (aChromeFlags & nsIWebBrowserChrome::CHROME_DEPENDENT) + NS_WARNING("dependent window created without a parent"); + nsCOMPtr appShell(do_GetService(kAppShellServiceCID)); if (!appShell) return NS_ERROR_FAILURE;