From ddf4e18bb23a89206428944d43b0647f5d637418 Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Sun, 19 Sep 2004 09:50:41 +0000 Subject: [PATCH] ensure a correct overflow area, even if the overflow is clipped, it should be the frame size under these conditions bug = 260241 r/sr=dbaron --- layout/html/table/src/nsTableFrame.cpp | 6 ++++-- layout/tables/nsTableFrame.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index d595ed3bb282..39944c5e5782 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -2071,13 +2071,15 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) { aDesiredSize.mMaximumWidth = GetPreferredWidth(); } + // make sure the table overflow area does include the table rect. + nsRect tableRect(0, 0, aDesiredSize.width, aDesiredSize.height) ; + if (!aReflowState.mStyleDisplay->IsTableClip()) { // collapsed border may leak out nsMargin bcMargin = GetBCMargin(aPresContext); - nsRect tableRect(0, 0, aDesiredSize.width, aDesiredSize.height) ; tableRect.Inflate(bcMargin); - aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, tableRect); } + aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, tableRect); if (aReflowState.mFlags.mSpecialHeightReflow) { SetNeedSpecialReflow(PR_FALSE); diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index d595ed3bb282..39944c5e5782 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -2071,13 +2071,15 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) { aDesiredSize.mMaximumWidth = GetPreferredWidth(); } + // make sure the table overflow area does include the table rect. + nsRect tableRect(0, 0, aDesiredSize.width, aDesiredSize.height) ; + if (!aReflowState.mStyleDisplay->IsTableClip()) { // collapsed border may leak out nsMargin bcMargin = GetBCMargin(aPresContext); - nsRect tableRect(0, 0, aDesiredSize.width, aDesiredSize.height) ; tableRect.Inflate(bcMargin); - aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, tableRect); } + aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, tableRect); if (aReflowState.mFlags.mSpecialHeightReflow) { SetNeedSpecialReflow(PR_FALSE);