From b931082c4315e25d5096a14b7b6bb959477eda5f Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 27 Aug 2010 18:15:08 -0500 Subject: [PATCH] Bug 130078. Part 1. Hookup view managers unconditionally. r=dbaron --- layout/base/nsDocumentViewer.cpp | 41 +++++--------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 8e899796647..0a7ade02f1e 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2388,17 +2388,13 @@ DocumentViewerImpl::FindContainerView() { nsIView* containerView = nsnull; - nsCOMPtr containerElement; - nsCOMPtr docShellItem = do_QueryReferent(mContainer); - nsCOMPtr pwin(do_GetInterface(docShellItem)); - if (pwin) { - containerElement = do_QueryInterface(pwin->GetFrameElementInternal()); - } - if (mParentWidget) { containerView = nsIView::GetViewFor(mParentWidget); - } else { - if (mContainer) { + } else if (mContainer) { + nsCOMPtr docShellItem = do_QueryReferent(mContainer); + nsCOMPtr pwin(do_GetInterface(docShellItem)); + if (pwin) { + nsCOMPtr containerElement = do_QueryInterface(pwin->GetFrameElementInternal()); nsCOMPtr parentPresShell; if (docShellItem) { nsCOMPtr parentDocShellItem; @@ -2442,32 +2438,7 @@ DocumentViewerImpl::FindContainerView() } } - if (!containerView) - return nsnull; - - if (containerElement && - containerElement->HasAttr(kNameSpaceID_None, nsGkAtoms::transparent)) - return containerView; - - nsIWidget* outerWidget = containerView->GetNearestWidget(nsnull); - if (outerWidget && - outerWidget->GetTransparencyMode() == eTransparencyTransparent) - return containerView; - - // If the parent container is a chrome shell and we are a content shell - // then we won't hook into its view - // tree. This will improve performance a little bit (especially given scrolling/painting perf bugs) - // but is really just for peace of mind. This check can be removed if we want to support fancy - // chrome effects like transparent controls floating over content, transparent Web browsers, and - // things like that, and the perf bugs are fixed. - nsCOMPtr container(do_QueryReferent(mContainer)); - if (container) { - nsCOMPtr sameTypeParent; - container->GetSameTypeParent(getter_AddRefs(sameTypeParent)); - if (sameTypeParent) - return containerView; - } - return nsnull; + return containerView; } nsresult