From eccee5177e237f16bbe388722a212d1878e7cc8c Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Thu, 14 Oct 1999 04:56:50 +0000 Subject: [PATCH] b=15388,15408 r=peterl@netscape.com Made it so that for absolutely positioned frames we pass in the containing block width/height to the HTML reflow state, rather than have it compute it. This means we get a bottom up size rather than a top down size. That fixes a problem where for containing blocks with a specified 'height' of 'auto' we weren't correctly calculating the containing block height --- layout/generic/nsAreaFrame.cpp | 12 +++++++----- layout/html/base/src/nsAreaFrame.cpp | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsAreaFrame.cpp b/layout/generic/nsAreaFrame.cpp index 0dd6b3afbfd8..4b0a864163a5 100644 --- a/layout/generic/nsAreaFrame.cpp +++ b/layout/generic/nsAreaFrame.cpp @@ -218,11 +218,13 @@ CalculateContainingBlock(const nsHTMLReflowState& aReflowState, aContainingBlockWidth = -1; // have reflow state calculate aContainingBlockHeight = -1; // have reflow state calculate - // We should probably do this for all frames, but for the time being just - // do this for relatively positioned block frames. The issue there is that - // for a 'height' of 'auto' the reflow state code won't know how to calculate - // the containing block height - if (NS_STYLE_POSITION_RELATIVE == aReflowState.mStylePosition->mPosition) { + // The issue there is that for a 'height' of 'auto' the reflow state code + // won't know how to calculate the containing block height because it's + // calculated bottom up. We don't really want to do this for the initial + // containing block so that's why we have the check for if the element + // is absolutely or relatively positioned + if (aReflowState.mStylePosition->IsAbsolutelyPositioned() || + (NS_STYLE_POSITION_RELATIVE == aReflowState.mStylePosition->mPosition)) { aContainingBlockWidth = aFrameWidth; aContainingBlockHeight = aFrameHeight; diff --git a/layout/html/base/src/nsAreaFrame.cpp b/layout/html/base/src/nsAreaFrame.cpp index 0dd6b3afbfd8..4b0a864163a5 100644 --- a/layout/html/base/src/nsAreaFrame.cpp +++ b/layout/html/base/src/nsAreaFrame.cpp @@ -218,11 +218,13 @@ CalculateContainingBlock(const nsHTMLReflowState& aReflowState, aContainingBlockWidth = -1; // have reflow state calculate aContainingBlockHeight = -1; // have reflow state calculate - // We should probably do this for all frames, but for the time being just - // do this for relatively positioned block frames. The issue there is that - // for a 'height' of 'auto' the reflow state code won't know how to calculate - // the containing block height - if (NS_STYLE_POSITION_RELATIVE == aReflowState.mStylePosition->mPosition) { + // The issue there is that for a 'height' of 'auto' the reflow state code + // won't know how to calculate the containing block height because it's + // calculated bottom up. We don't really want to do this for the initial + // containing block so that's why we have the check for if the element + // is absolutely or relatively positioned + if (aReflowState.mStylePosition->IsAbsolutelyPositioned() || + (NS_STYLE_POSITION_RELATIVE == aReflowState.mStylePosition->mPosition)) { aContainingBlockWidth = aFrameWidth; aContainingBlockHeight = aFrameHeight;