From 9acb9492ecbd84eea39d8a0faeceeeb3efd0b91d Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Sun, 5 Feb 2006 20:52:13 +0000 Subject: [PATCH] Bug 78087. Propagate the canvas background to be the background of the entire viewport so it z-orders correctly in the viewport's stacking context. r+sr=dbaron --- layout/generic/nsGfxScrollFrame.cpp | 3 ++- layout/generic/nsViewportFrame.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index be21b0d65fc5..a19f49f4530c 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1392,7 +1392,8 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder, NS_ENSURE_SUCCESS(rv, rv); nsRect clip = frameClip + aBuilder->ToReferenceFrame(mOuter); // mScrolledFrame may have given us a background, e.g., the scrolled canvas - // frame below the viewport. If so, we want it to be clipped. + // frame below the viewport. If so, we want it to be clipped. We also want + // to end up on our BorderBackground list. // If we are the viewport scrollframe, then clip all our descendants (to ensure // that fixed-pos elements get clipped by us). rv = mOuter->OverflowClip(aBuilder, set, aLists, clip, PR_TRUE, mIsRoot); diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp index cb6298bf10d5..6ea6ee25539e 100644 --- a/layout/generic/nsViewportFrame.cpp +++ b/layout/generic/nsViewportFrame.cpp @@ -89,10 +89,12 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // that display list construction is guaranteed to recurse into their // ancestors. MarkOutOfFlowChildrenForDisplayList(mFixedContainer.GetFirstChild(), aDirtyRect); - // Put the regular child in a pseudo-stack. - nsresult rv = - BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists, - DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT); + nsIFrame* kid = mFrames.FirstChild(); + nsresult rv = NS_OK; + if (kid) { + // make the kid's BorderBackground our own. + rv = BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists); + } UnmarkOutOfFlowChildrenForDisplayList(mFixedContainer.GetFirstChild()); return rv; }