Bug 476557. Update view manager cache of page background color in PresShell::Paint, not nsCSSRendering::PaintBackground; permits a small API cleanup. r+sr=roc

This commit is contained in:
Zack Weinberg
2009-02-16 14:11:34 +13:00
parent a065983b4d
commit c6de6120b4
8 changed files with 119 additions and 101 deletions

View File

@@ -482,27 +482,24 @@ IsTopLevelWidget(nsPresContext* aPresContext)
}
static void
SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
nsIFrame* aFrame,
nsStyleContext* aStyleContext,
nsIView* aView,
PRUint32 aFlags)
{
#ifdef MOZ_XUL
nsIViewManager* vm = aView->GetViewManager();
PRBool isCanvas;
const nsStyleBackground* bg;
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
if (!isCanvas)
if (!nsCSSRendering::IsCanvasFrame(aFrame))
return;
if (!aView->HasWidget() || !IsTopLevelWidget(aPresContext))
return;
nsIViewManager* vm = aView->GetViewManager();
nsIView* rootView;
vm->GetRootView(rootView);
if (!aView->HasWidget() || aView != rootView ||
!IsTopLevelWidget(aPresContext))
if (aView != rootView)
return;
nsIContent* rootContent = aPresContext->Document()->GetRootContent();