From 662a18f196b0d14585f0f4f41ccc1128210462db Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Tue, 6 Jan 2015 09:27:56 +0000 Subject: [PATCH] Bug 1116718 part 1 - Don't bother calculating overflow areas when they will be discarded anyway. r=roc --- layout/generic/nsViewportFrame.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp index 0f51337414b..b140e14f392 100644 --- a/layout/generic/nsViewportFrame.cpp +++ b/layout/generic/nsViewportFrame.cpp @@ -252,18 +252,16 @@ ViewportFrame::Reflow(nsPresContext* aPresContext, } nsRect rect = AdjustReflowStateAsContainingBlock(&reflowState); - - // Just reflow all the fixed-pos frames. - GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowState, aStatus, - rect, - false, true, true, // XXX could be optimized - &aDesiredSize.mOverflowAreas); - + nsOverflowAreas* overflowAreas = &aDesiredSize.mOverflowAreas; nsIScrollableFrame* rootScrollFrame = aPresContext->PresShell()->GetRootScrollFrameAsScrollable(); if (rootScrollFrame && !rootScrollFrame->IsIgnoringViewportClipping()) { - aDesiredSize.SetOverflowAreasToDesiredBounds(); + overflowAreas = nullptr; } + GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowState, aStatus, + rect, + false, true, true, // XXX could be optimized + overflowAreas); } if (mFrames.NotEmpty()) {