Bug 507926. Make sure CreateWindowEx doesn't fail when we're creating an invisible window. r=jmathies

This commit is contained in:
Robert O'Callahan 2009-08-25 12:00:46 -07:00
parent 0535295ab4
commit 02bbe8dd79
2 changed files with 12 additions and 1 deletions

View File

@ -2315,7 +2315,11 @@ DocumentViewerImpl::FindContainerView()
parentDocShell->GetPresShell(getter_AddRefs(parentPresShell));
}
}
if (content && parentPresShell) {
if (!content) {
NS_WARNING("Subdocument container has no content");
} else if (!parentPresShell) {
NS_WARNING("Subdocument container has no presshell");
} else {
nsIFrame* f = parentPresShell->GetRealPrimaryFrameFor(content);
if (f) {
nsIFrame* subdocFrame = f->GetContentInsertionFrame();
@ -2329,7 +2333,11 @@ DocumentViewerImpl::FindContainerView()
nsIView* innerView = subdocFrameView->GetFirstChild();
NS_ASSERTION(innerView, "Subdoc frames must have an inner view too");
containerView = innerView;
} else {
NS_WARNING("Subdocument container has non-subdocument frame");
}
} else {
NS_WARNING("Subdocument container has no frame");
}
}
}

View File

@ -642,6 +642,9 @@ nsWindow::StandardWindowCreate(nsIWidget *aParent,
extendedStyle = WS_EX_TOOLWINDOW;
else
parent = NULL;
} else if (mWindowType == eWindowType_invisible) {
// Make sure CreateWindowEx succeeds at creating a toplevel window
style &= ~WS_CHILDWINDOW;
} else if (nsnull != aInitData) {
// See if the caller wants to explictly set clip children and clip siblings
if (aInitData->clipChildren) {