Bug 1166301 - Allow async scrolling to move the clip rects of fixed background layers. r=mattwoodrow
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -362,18 +362,22 @@ AsyncCompositionManager::AlignFixedAndSt
// Finally, apply the translation to the layer transform. Note that in
// general we need to apply the same translation to the layer's clip rect, so
// that the effective transform on the clip rect takes it back to where it was
// originally, had there been no async scroll. In the case where the
// fixed/sticky layer is the same as aTransformedSubtreeRoot, then the clip
// rect is not affected by the scroll-induced async scroll transform anyway
// (since the clip is applied post-transform) so we don't need to make the
- // adjustment.
- TranslateShadowLayer(aLayer, ThebesPoint(translation), aLayer != aTransformedSubtreeRoot);
+ // adjustment. Also, if a layer is a fixed background layer, we want async
+ // scrolling to move its clip rect, so we don't make a compensating
+ // adjustment here.
+ bool adjustClipRect = aLayer != aTransformedSubtreeRoot &&
+ !aLayer->IsFixedBackground();
+ TranslateShadowLayer(aLayer, ThebesPoint(translation), adjustClipRect);
}
static void
SampleValue(float aPortion, Animation& aAnimation, StyleAnimationValue& aStart,
StyleAnimationValue& aEnd, Animatable* aValue)
{
StyleAnimationValue interpolatedValue;
NS_ASSERTION(aStart.GetUnit() == aEnd.GetUnit() ||