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
Родитель a5beb085b9
Коммит 46904b4862
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -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");
}
}
}

Просмотреть файл

@ -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) {