From 09a7cb12fb10e8d258ddb68da02e3042076e1751 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Tue, 11 Mar 2008 08:36:03 +0000 Subject: [PATCH] Backing out bug 413027 git-svn-id: svn://10.0.0.236/trunk@247536 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrame.cpp | 27 ++++++++++++++++++++++- mozilla/layout/reftests/bugs/reftest.list | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 4d265a23ebf..472c1c60f53 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -5854,7 +5854,32 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState) Redraw(aState, &newRect); } - metrics->mBlockMinSize.height = metrics->mBlockPrefSize.height = newRect.height; + metrics->mBlockMinSize.height = 0; + // ok we need the max ascent of the items on the line. So to do this + // ask the block for its line iterator. Get the max ascent. + nsCOMPtr lines = do_QueryInterface(static_cast(this)); + if (lines) + { + metrics->mBlockMinSize.height = 0; + int count = 0; + nsIFrame* firstFrame = nsnull; + PRInt32 framesOnLine; + nsRect lineBounds; + PRUint32 lineFlags; + + do { + lines->GetLine(count, &firstFrame, &framesOnLine, lineBounds, &lineFlags); + + if (lineBounds.height > metrics->mBlockMinSize.height) + metrics->mBlockMinSize.height = lineBounds.height; + + count++; + } while(firstFrame); + } else { + metrics->mBlockMinSize.height = desiredSize.height; + } + + metrics->mBlockPrefSize.height = metrics->mBlockMinSize.height; if (desiredSize.ascent == nsHTMLReflowMetrics::ASK_FOR_BASELINE) { if (!nsLayoutUtils::GetFirstLineBaseline(this, &metrics->mBlockAscent)) diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index 8756ecaff98..104c6b97f07 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -720,7 +720,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377 == 412607-1b.html 412607-1-ref.html == 412679-1.html 412679-1-ref.html == 412679-2.html 412679-2-ref.html -== 413027-1.html 413027-1-ref.html +# == 413027-1.html 413027-1-ref.html == 413286-1a.html 413286-1-ref.html == 413286-1b.html 413286-1-ref.html == 413286-1c.html 413286-1-ref.html