From 5f5e4c2d48b213f4438b3ea2bfebdf9180f592f9 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sat, 6 Sep 2014 16:16:33 +1200 Subject: [PATCH] Bug 1062100. Part 1: Remove ItemCoversScrollableArea. r=mattwoodrow This isn't really part of this bug but it simplifies related code. --- layout/base/FrameLayerBuilder.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 40dc220bcda4..64e026aa1362 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -2654,24 +2654,6 @@ IsScrollLayerItemAndOverlayScrollbarForScrollFrame( return false; } -bool -ContainerState::ItemCoversScrollableArea(nsDisplayItem* aItem, const nsRegion& aOpaque) -{ - nsIPresShell* presShell = aItem->Frame()->PresContext()->PresShell(); - nsIFrame* rootFrame = presShell->GetRootFrame(); - if (mContainerFrame != rootFrame) { - return false; - } - nsRect scrollableArea; - if (presShell->IsScrollPositionClampingScrollPortSizeSet()) { - scrollableArea = nsRect(nsPoint(0, 0), - presShell->GetScrollPositionClampingScrollPortSize()); - } else { - scrollableArea = rootFrame->GetRectRelativeToSelf(); - } - return aOpaque.Contains(scrollableArea); -} - nsIntRegion ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem, const nsIFrame* aAnimatedGeometryRoot, @@ -2692,8 +2674,8 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem, } if (aAnimatedGeometryRoot == mContainerAnimatedGeometryRoot && aFixedPosFrame == mContainerFixedPosFrame && - !aList->IsOpaque() && opaqueClipped.Contains(mContainerBounds)) { + *aHideAllLayersBelow = true; aList->SetIsOpaque(); } // Add opaque areas to the "exclude glass" region. Only do this when our @@ -2704,9 +2686,6 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem, mBuilder->AddWindowOpaqueRegion(opaqueClipped); } opaquePixels = ScaleRegionToInsidePixels(opaqueClipped, snapOpaque); - if (aFixedPosFrame && ItemCoversScrollableArea(aItem, opaque)) { - *aHideAllLayersBelow = true; - } nsIScrollableFrame* sf = nsLayoutUtils::GetScrollableFrameFor(aAnimatedGeometryRoot); if (sf) { @@ -3575,7 +3554,7 @@ ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer if (!data) { if (animatedGeometryRootToCover == mContainerAnimatedGeometryRoot && - !e->mFixedPosFrameForLayerData) { + e->mFixedPosFrameForLayerData == mContainerFixedPosFrame) { NS_ASSERTION(opaqueRegionForContainer == -1, "Already found it?"); opaqueRegionForContainer = opaqueRegions.Length(); }