Bug 559705 - "ASSERTION: Subdoc frames must have an inner view too". r=roc a2.0=roc

This commit is contained in:
Mats Palmgren 2010-09-18 13:28:50 +02:00
Родитель 356758381c
Коммит 206b8e0650
4 изменённых файлов: 9 добавлений и 13 удалений

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

@ -662,7 +662,7 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
}
}
nsIView* view = frame->CreateViewAndWidget(contentType);
nsIView* view = frame->EnsureInnerView();
if (!view)
return PR_FALSE;

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

@ -63,6 +63,7 @@
#include "nsIStyleSheet.h"
#include "nsCSSStyleSheet.h"
#include "nsIFrame.h"
#include "nsSubDocumentFrame.h"
#include "nsILinkHandler.h"
#include "nsIDOMDocument.h"
@ -79,7 +80,6 @@
#include "nsLayoutStylesheetCache.h"
#include "nsViewsCID.h"
#include "nsWidgetsCID.h"
#include "nsIDeviceContext.h"
#include "nsIDeviceContextSpec.h"
#include "nsIViewManager.h"
@ -2416,10 +2416,9 @@ DocumentViewerImpl::FindContainerView()
// cases. Treat that as display:none, the document is not
// displayed.
if (subdocFrame->GetType() == nsGkAtoms::subDocumentFrame) {
nsIView* subdocFrameView = subdocFrame->GetView();
NS_ASSERTION(subdocFrameView, "Subdoc frames must have views");
nsIView* innerView = subdocFrameView->GetFirstChild();
NS_ASSERTION(innerView, "Subdoc frames must have an inner view too");
NS_ASSERTION(subdocFrame->GetView(), "Subdoc frames must have views");
nsIView* innerView =
static_cast<nsSubDocumentFrame*>(subdocFrame)->EnsureInnerView();
containerView = innerView;
} else {
NS_WARNING("Subdocument container has non-subdocument frame");

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

@ -69,8 +69,6 @@ using mozilla::layout::RenderFrameParent;
#include "nsIDocument.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsWidgetsCID.h"
#include "nsViewsCID.h"
#include "nsGkAtoms.h"
#include "nsStyleCoord.h"
#include "nsStyleContext.h"
@ -221,8 +219,8 @@ nsSubDocumentFrame::ShowViewer()
if (!PresContext()->IsDynamic()) {
// We let the printing code take care of loading the document; just
// create a widget for it to use
(void) CreateViewAndWidget(eContentTypeContent);
// create the inner view for it to use.
(void) EnsureInnerView();
} else {
nsRefPtr<nsFrameLoader> frameloader = FrameLoader();
if (frameloader) {
@ -1011,10 +1009,9 @@ nsSubDocumentFrame::EndSwapDocShells(nsIFrame* aOther)
}
nsIView*
nsSubDocumentFrame::CreateViewAndWidget(nsContentType aContentType)
nsSubDocumentFrame::EnsureInnerView()
{
if (mInnerView) {
// Nothing to do here
return mInnerView;
}

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

@ -117,7 +117,7 @@ public:
nsresult GetDocShell(nsIDocShell **aDocShell);
nsresult BeginSwapDocShells(nsIFrame* aOther);
void EndSwapDocShells(nsIFrame* aOther);
nsIView* CreateViewAndWidget(nsContentType aContentType);
nsIView* EnsureInnerView();
nsIFrame* GetSubdocumentRootFrame();
// nsIReflowCallback