Bug 413027. The XUL min-size and pref-size for a CSS block should just be its height when reflowed at its preferred width --- NOT the height of the tallest line, that is insane. r+sr=dbaron

This commit is contained in:
roc+@cs.cmu.edu 2008-03-11 00:38:26 -07:00
Родитель d0d7ea0e4b
Коммит 0256087181
1 изменённых файлов: 1 добавлений и 26 удалений

Просмотреть файл

@ -5854,32 +5854,7 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState)
Redraw(aState, &newRect);
}
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<nsILineIterator> lines = do_QueryInterface(static_cast<nsIFrame*>(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;
metrics->mBlockMinSize.height = metrics->mBlockPrefSize.height = newRect.height;
if (desiredSize.ascent == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
if (!nsLayoutUtils::GetFirstLineBaseline(this, &metrics->mBlockAscent))