Revert temporary landing of 130078

This commit is contained in:
Chris Jones 2010-08-31 00:32:24 -05:00
parent 06af911885
commit b4fc7982d0
2 changed files with 46 additions and 6 deletions

View File

@ -2388,11 +2388,17 @@ DocumentViewerImpl::FindContainerView()
{
nsIView* containerView = nsnull;
if (mContainer) {
nsCOMPtr<nsIDocShellTreeItem> docShellItem = do_QueryReferent(mContainer);
nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(docShellItem));
if (pwin) {
nsCOMPtr<nsIContent> containerElement = do_QueryInterface(pwin->GetFrameElementInternal());
nsCOMPtr<nsIContent> containerElement;
nsCOMPtr<nsIDocShellTreeItem> docShellItem = do_QueryReferent(mContainer);
nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(docShellItem));
if (pwin) {
containerElement = do_QueryInterface(pwin->GetFrameElementInternal());
}
if (mParentWidget) {
containerView = nsIView::GetViewFor(mParentWidget);
} else {
if (mContainer) {
nsCOMPtr<nsIPresShell> parentPresShell;
if (docShellItem) {
nsCOMPtr<nsIDocShellTreeItem> parentDocShellItem;
@ -2430,7 +2436,32 @@ DocumentViewerImpl::FindContainerView()
}
}
return containerView;
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<nsIDocShellTreeItem> container(do_QueryReferent(mContainer));
if (container) {
nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
container->GetSameTypeParent(getter_AddRefs(sameTypeParent));
if (sameTypeParent)
return containerView;
}
return nsnull;
}
nsresult

View File

@ -963,6 +963,15 @@ nsSubDocumentFrame::CreateViewAndWidget(nsContentType aContentType)
mInnerView = innerView;
viewMan->InsertChild(outerView, innerView, nsnull, PR_TRUE);
if (aContentType == eContentTypeContent) {
// widget needed.
nsresult rv = innerView->CreateWidget(nsnull,
PR_TRUE, PR_TRUE, aContentType);
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't create widget for frame.");
mInnerView = nsnull;
}
}
return mInnerView;
}