From b645ac630bb14c27dd32312345df2b7b3522698c Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Mon, 8 Mar 1999 19:25:03 +0000 Subject: [PATCH] Copy out computed combined area even when dealing with an zero height block; added some nasty logging messages for frames that don't set max-element-size --- layout/generic/nsBlockReflowContext.cpp | 20 ++++++++++++++++++- layout/html/base/src/nsBlockReflowContext.cpp | 20 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index a45d247dfc3f..5ccb35f8d69f 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -132,6 +132,13 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, } htmlReflow->WillReflow(mPresContext); +#ifdef DEBUG + if (nsnull != mMetrics.maxElementSize) { + mMetrics.maxElementSize->width = nscoord(0xdeadbeef); + mMetrics.maxElementSize->height = nscoord(0xdeadbeef); + } +#endif + // Adjust spacemanager coordinate system for the frame. The // spacemanager coordinates are inside the callers // border+padding, but the x/y coordinates are not (recall that @@ -150,6 +157,17 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, NS_ASSERTION((mMetrics.width > -200000) && (mMetrics.width < 200000), "oy"); NS_ASSERTION((mMetrics.height > -200000) && (mMetrics.height < 200000), "oy"); #endif +#ifdef DEBUG + if ((nsnull != mMetrics.maxElementSize) && + ((nscoord(0xdeadbeef) == mMetrics.maxElementSize->width) || + (nscoord(0xdeadbeef) == mMetrics.maxElementSize->height))) { + printf("nsBlockReflowContext: "); + nsFrame::ListTag(stdout, aFrame); + printf(" didn't set max-element-size!\n"); + mMetrics.maxElementSize->width = 0; + mMetrics.maxElementSize->height = 0; + } +#endif aFrame->GetFrameState(&state); if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) { @@ -293,7 +311,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, nsRect r(mX, mY, 0, 0); mFrame->SetRect(r); aInFlowBounds = r; - aCombinedRect = r; + aCombinedRect = mMetrics.mCombinedArea; fits = PR_TRUE; } else { diff --git a/layout/html/base/src/nsBlockReflowContext.cpp b/layout/html/base/src/nsBlockReflowContext.cpp index a45d247dfc3f..5ccb35f8d69f 100644 --- a/layout/html/base/src/nsBlockReflowContext.cpp +++ b/layout/html/base/src/nsBlockReflowContext.cpp @@ -132,6 +132,13 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, } htmlReflow->WillReflow(mPresContext); +#ifdef DEBUG + if (nsnull != mMetrics.maxElementSize) { + mMetrics.maxElementSize->width = nscoord(0xdeadbeef); + mMetrics.maxElementSize->height = nscoord(0xdeadbeef); + } +#endif + // Adjust spacemanager coordinate system for the frame. The // spacemanager coordinates are inside the callers // border+padding, but the x/y coordinates are not (recall that @@ -150,6 +157,17 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, NS_ASSERTION((mMetrics.width > -200000) && (mMetrics.width < 200000), "oy"); NS_ASSERTION((mMetrics.height > -200000) && (mMetrics.height < 200000), "oy"); #endif +#ifdef DEBUG + if ((nsnull != mMetrics.maxElementSize) && + ((nscoord(0xdeadbeef) == mMetrics.maxElementSize->width) || + (nscoord(0xdeadbeef) == mMetrics.maxElementSize->height))) { + printf("nsBlockReflowContext: "); + nsFrame::ListTag(stdout, aFrame); + printf(" didn't set max-element-size!\n"); + mMetrics.maxElementSize->width = 0; + mMetrics.maxElementSize->height = 0; + } +#endif aFrame->GetFrameState(&state); if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) { @@ -293,7 +311,7 @@ nsBlockReflowContext::PlaceBlock(PRBool aForceFit, nsRect r(mX, mY, 0, 0); mFrame->SetRect(r); aInFlowBounds = r; - aCombinedRect = r; + aCombinedRect = mMetrics.mCombinedArea; fits = PR_TRUE; } else {