From feb68c2f7a76ab17da63d2e2bf8b6405f234cd46 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 12 Mar 2002 15:29:33 +0000 Subject: [PATCH] Account for scrollbar in incremental reflow of fixed-pos elements. Bug 130002, r=dbaron, sr=attinasi, a=roc+moz git-svn-id: svn://10.0.0.236/trunk@116405 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsViewportFrame.cpp | 16 +++++++++++++++- mozilla/layout/html/base/src/nsViewportFrame.cpp | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index 26989d6a2dc..374268008ec 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -553,8 +553,22 @@ ViewportFrame::Reflow(nsIPresContext* aPresContext, if ((eReflowReason_Incremental == aReflowState.reason) && (mFixedFrames.ContainsFrame(nextFrame))) { // Reflow the 'fixed' frame that's the next frame in the reflow path + + // Calculate how much room is available for the fixed frame. That means + // determining if the viewport is scrollable and whether the vertical and/or + // horizontal scrollbars are visible + nscoord width, height; + CalculateFixedContainingBlockSize(aPresContext, aReflowState, width, height); + + // Make a copy of the reflow state and change the computed width and height + // to reflect the available space for the fixed items + // XXX Find a cleaner way to do this... + nsHTMLReflowState reflowState(aReflowState); + reflowState.mComputedWidth = width; + reflowState.mComputedHeight = height; + nsReflowStatus kidStatus; - ReflowFixedFrame(aPresContext, aReflowState, nextFrame, PR_FALSE, + ReflowFixedFrame(aPresContext, reflowState, nextFrame, PR_FALSE, kidStatus); } else { diff --git a/mozilla/layout/html/base/src/nsViewportFrame.cpp b/mozilla/layout/html/base/src/nsViewportFrame.cpp index 26989d6a2dc..374268008ec 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.cpp +++ b/mozilla/layout/html/base/src/nsViewportFrame.cpp @@ -553,8 +553,22 @@ ViewportFrame::Reflow(nsIPresContext* aPresContext, if ((eReflowReason_Incremental == aReflowState.reason) && (mFixedFrames.ContainsFrame(nextFrame))) { // Reflow the 'fixed' frame that's the next frame in the reflow path + + // Calculate how much room is available for the fixed frame. That means + // determining if the viewport is scrollable and whether the vertical and/or + // horizontal scrollbars are visible + nscoord width, height; + CalculateFixedContainingBlockSize(aPresContext, aReflowState, width, height); + + // Make a copy of the reflow state and change the computed width and height + // to reflect the available space for the fixed items + // XXX Find a cleaner way to do this... + nsHTMLReflowState reflowState(aReflowState); + reflowState.mComputedWidth = width; + reflowState.mComputedHeight = height; + nsReflowStatus kidStatus; - ReflowFixedFrame(aPresContext, aReflowState, nextFrame, PR_FALSE, + ReflowFixedFrame(aPresContext, reflowState, nextFrame, PR_FALSE, kidStatus); } else {