Bug 413027. The XUL pref and min height for a CSS block should be its height when reflowed at its preferred width, NOT the height of the tallest line. r+sr=dbaron. Relanding with extra instrumentation in the strangely-failing mochitest test_bug199692.xul

This commit is contained in:
roc+@cs.cmu.edu 2008-03-11 18:05:26 -07:00
Родитель deec116f37
Коммит 75285030c0
2 изменённых файлов: 4 добавлений и 27 удалений

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

@ -64,7 +64,9 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
function test(ptFunc, id, message) {
var pt = ptFunc($(id));
is(document.elementFromPoint(pt.x, pt.y).id, id, message);
var e = document.elementFromPoint(pt.x, pt.y);
ok(e != null, message + " (returned null)");
is(e.id, id, message);
}
function do_test() {

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

@ -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))