From 5dbc4242ca4b1be36695a8f4bc038d40999d091c Mon Sep 17 00:00:00 2001 From: Benjamin Stover Date: Wed, 13 Apr 2011 14:12:22 -0700 Subject: [PATCH] Bug 649583 Panning regression on google reader in 2011-04-12 nightly r=roc --- layout/base/FrameLayerBuilder.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 006ebfdb7a8e..3c46e9755cd2 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -1314,15 +1314,23 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList, // Assign the item to a layer if (layerState == LAYER_ACTIVE_FORCE || + layerState == LAYER_ACTIVE_EMPTY || layerState == LAYER_ACTIVE && (aClip.mRoundedClipRects.IsEmpty() || // We can use the visible rect here only because the item has its own // layer, like the comment below. !aClip.IsRectClippedByRoundedCorner(item->GetVisibleRect()))) { + + // LAYER_ACTIVE_EMPTY means the layer is created just for its metadata. + // We should never see an empty layer with any visible content! + NS_ASSERTION(layerState != LAYER_ACTIVE_EMPTY || + itemVisibleRect.IsEmpty(), + "State is LAYER_ACTIVE_EMPTY but visible rect is not."); + // If the item would have its own layer but is invisible, just hide it. // Note that items without their own layers can't be skipped this // way, since their ThebesLayer may decide it wants to draw them // into its buffer even if they're currently covered. - if (itemVisibleRect.IsEmpty()) { + if (itemVisibleRect.IsEmpty() && layerState != LAYER_ACTIVE_EMPTY) { InvalidateForLayerChange(item, nsnull); continue; }