Bug 625288. Part 1: Don't create nsDisplaySolidColors with zero alpha. They just confuse our display list analysis. r=tnikkel,a=blocking

This commit is contained in:
Robert O'Callahan 2011-01-16 23:38:45 +13:00
parent 0c3dfcf61b
commit 27268fea3d
2 changed files with 3 additions and 0 deletions

View File

@ -1409,6 +1409,7 @@ public:
nsDisplaySolidColor(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
const nsRect& aBounds, nscolor aColor)
: nsDisplayItem(aBuilder, aFrame), mBounds(aBounds), mColor(aColor) {
NS_ASSERTION(NS_GET_A(aColor) > 0, "Don't create invisible nsDisplaySolidColors!");
MOZ_COUNT_CTOR(nsDisplaySolidColor);
}
#ifdef NS_BUILD_REFCNT_LOGGING

View File

@ -5853,6 +5853,8 @@ nsresult PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
return NS_OK;
nscolor bgcolor = NS_ComposeColors(aBackstopColor, mCanvasBackgroundColor);
if (NS_GET_A(bgcolor) == 0)
return NS_OK;
// To make layers work better, we want to avoid having a big non-scrolled
// color background behind a scrolled transparent background. Instead,