From 68d407c357f293f64e9ce64305d81c788655d110 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Fri, 13 Dec 2013 19:37:34 +0000 Subject: [PATCH] Bug 936500 - Always build layers for nsDisplayScrollLayer. r=tn APZC information is associated with layers, and having those layers suddenly disappear because they became occluded, or their displayports are off-screen has undesired effects. --- layout/base/nsDisplayList.cpp | 10 ++++++++++ layout/base/nsDisplayList.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 6f9a0537017..b2999c01280 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3498,6 +3498,16 @@ nsDisplayScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder, return layer.forget(); } +bool +nsDisplayScrollLayer::ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) +{ + if (nsLayoutUtils::GetDisplayPort(mScrolledFrame->GetContent(), nullptr)) { + return true; + } + + return nsDisplayWrapList::ShouldBuildLayerEvenIfInvisible(aBuilder); +} + bool nsDisplayScrollLayer::ComputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion, diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 2b28efd826c..77a5fab0311 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2713,6 +2713,8 @@ public: LayerManager* aManager, const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE; + virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE; + virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion, const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;