From 4682c37ce56b6730353f2224ecb50ce3251d64e8 Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Wed, 8 Sep 2010 10:52:58 -0500 Subject: [PATCH] Bug 593440 - Remove remaining child widgets on windows. r=roc, a=joe. --- layout/base/nsDocumentViewer.cpp | 4 +++- widget/src/xpwidgets/nsBaseWidget.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index aaf765102d6..84f21664fac 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2279,7 +2279,9 @@ DocumentViewerImpl::MakeWindow(const nsSize& aSize, nsIView* aContainerView) nsWindowType winType; containerItem->GetItemType(&docType); mParentWidget->GetWindowType(winType); - if (winType == eWindowType_toplevel && + if ((winType == eWindowType_toplevel || + winType == eWindowType_dialog || + winType == eWindowType_invisible) && docType == nsIDocShellTreeItem::typeChrome) { // If the old view is already attached to our parent, detach DetachFromTopLevelWidget(); diff --git a/widget/src/xpwidgets/nsBaseWidget.cpp b/widget/src/xpwidgets/nsBaseWidget.cpp index 0975b9cf537..1a42bac6b69 100644 --- a/widget/src/xpwidgets/nsBaseWidget.cpp +++ b/widget/src/xpwidgets/nsBaseWidget.cpp @@ -292,7 +292,10 @@ NS_IMETHODIMP nsBaseWidget::AttachViewToTopLevel(EVENT_CALLBACK aViewEventFunction, nsIDeviceContext *aContext) { - NS_ASSERTION((mWindowType == eWindowType_toplevel), "Can't attach to child?"); + NS_ASSERTION((mWindowType == eWindowType_toplevel || + mWindowType == eWindowType_dialog || + mWindowType == eWindowType_invisible), + "Can't attach to child?"); mViewCallback = aViewEventFunction;