From bdb7838ac2b986ab8aec7c8a043ca92303b9d365 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Mon, 16 May 2016 17:20:23 -0400 Subject: [PATCH] Bug 1273250 - Set a layer clip rather than a scroll clip for fixed background layers if the clip moves with the layer. r=mstange This patch also removes the earlier workaround added in bug 1272525. MozReview-Commit-ID: HR2wF2BGsKl --HG-- extra : rebase_source : b561f8721d91c930bced7664f11a331552b97a5e extra : histedit_source : d57e430f76851ce252416aa77fdaad0897d03756 --- layout/base/FrameLayerBuilder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 318df816c9e2..55094a47ca38 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -3880,8 +3880,11 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) item->SetClip(mBuilder, clip); } - bool shouldFixToViewport = !(*animatedGeometryRoot)->GetParent() && - item->ShouldFixToViewport(mBuilder); + bool clipMovesWithLayer = (animatedGeometryRoot == animatedGeometryRootForClip); + + bool shouldFixToViewport = !clipMovesWithLayer && + !(*animatedGeometryRoot)->GetParent() && + item->ShouldFixToViewport(mBuilder); // For items that are fixed to the viewport, remove their clip at the // display item level because additional areas could be brought into @@ -4120,7 +4123,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) // scrolled clips, and doesn't care about the distinction anyways // (it only matters for async scrolling), so only set a scrolled clip // if we have a widget layer manager. - if (shouldFixToViewport && mManager->IsWidgetLayerManager()) { + if (shouldFixToViewport) { LayerClip scrolledClip; scrolledClip.SetClipRect(layerClipRect); if (layerClip.IsRectClippedByRoundedCorner(itemContent)) {