From 4cedbfdd707210779d90a634aa8f8790213206cd Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Thu, 20 Dec 2007 19:25:36 -0800 Subject: [PATCH] Bug 408749. Reflow captions with unconstrained height, because we have no logic to reflow their continuations. r+sr=bzbarsky --- layout/tables/nsTableOuterFrame.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index a5c9f3c0b1e1..42d470671af9 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -1113,15 +1113,19 @@ nsTableOuterFrame::OuterReflowChild(nsPresContext* aPresContext, // work around pixel rounding errors, round down to ensure we don't exceed the avail height in nscoord availHeight = aOuterRS.availableHeight; if (NS_UNCONSTRAINEDSIZE != availHeight) { - nsMargin margin; - GetMargin(aPresContext, aOuterRS, aChildFrame, aOuterRS.availableWidth, - margin); + if (mCaptionFrame == aChildFrame) { + availHeight = NS_UNCONSTRAINEDSIZE; + } else { + nsMargin margin; + GetMargin(aPresContext, aOuterRS, aChildFrame, aOuterRS.availableWidth, + margin); - NS_ASSERTION(NS_UNCONSTRAINEDSIZE != margin.top, "No unconstrainedsize arithmetic, please"); - availHeight -= margin.top; - - NS_ASSERTION(NS_UNCONSTRAINEDSIZE != margin.bottom, "No unconstrainedsize arithmetic, please"); - availHeight -= margin.bottom; + NS_ASSERTION(NS_UNCONSTRAINEDSIZE != margin.top, "No unconstrainedsize arithmetic, please"); + availHeight -= margin.top; + + NS_ASSERTION(NS_UNCONSTRAINEDSIZE != margin.bottom, "No unconstrainedsize arithmetic, please"); + availHeight -= margin.bottom; + } } nsSize availSize(aAvailWidth, availHeight); // create and init the child reflow state, using placement new on