more error checking, a missing GetIID method and another test button should fix bug 6751. a:chofmann

This commit is contained in:
danm%netscape.com 1999-05-20 02:24:31 +00:00
parent 5f33c29784
commit 8f33434d3e
3 changed files with 11 additions and 3 deletions

View File

@ -56,6 +56,7 @@ struct nsRect;
*/
class nsIBrowserWindow : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IBROWSER_WINDOW_IID; return iid; }
NS_IMETHOD Init(nsIAppShell* aAppShell,
nsIPref* aPrefs,
const nsRect& aBounds,

View File

@ -1859,9 +1859,9 @@ void nsWebShellWindow::ShowAppropriateChrome()
// get this window's document
if (NS_FAILED(ConvertWebShellToDOMWindow(mWebShell, getter_AddRefs(domWindow))))
return;
if (NS_FAILED(domWindow->GetDocument(getter_AddRefs(chromeDoc))))
if (NS_FAILED(domWindow->GetDocument(getter_AddRefs(chromeDoc))) || !chromeDoc)
return;
if (NS_FAILED(chromeDoc->GetDocumentElement(getter_AddRefs(rootElement))))
if (NS_FAILED(chromeDoc->GetDocumentElement(getter_AddRefs(rootElement))) || !rootElement)
return;
// get a list of this document's elements with the chromeclass attribute specified

View File

@ -12,9 +12,13 @@
<![CDATA[
var dialogWindow = null;
function NewBrowser() {
return window.open("http://www.mozilla.org/", "New");
}
// show a nonmodal dialog, sending parameters as part of the URL
function MakeURLDialog() {
var newWin = window.open("resource://res/samples/dexparamdialog.xul?remind=true;prompt=Give me your money and convertible bonds", "New");
var newWin = window.open("resource://res/samples/dexparamdialog.xul?remind=true;prompt=Give me your money and convertible bonds", "New", "chrome");
return newWin;
}
@ -89,6 +93,9 @@
<xul:titledbutton
value="Modal Dialog" onclick="ModalDialog()"
style="background-color:rgb(192,192,192);"/>
<xul:titledbutton
value="New Browser" onclick="NewBrowser()"
style="background-color:rgb(192,192,192);"/>
<xul:titledbutton
value="Dump Window" onclick="DumpLastDialog()"
style="background-color:rgb(192,192,192);"/>