Bug 1293242 - Part 1 - Use the computed preferred height of block in box instead of the minimum height. r=dbaron
This allows the preferred height of a block in box to be computed better. This affects the storage tab in the developer tools as it contains an inline text element with a large padding; the padding isn't being included in the preferred size. I don't adjust the minimum height computation to minimize code change; there is some discussion of this code in
bug 413027.
MozReview-Commit-ID: BemwJJxNfH6
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -9723,17 +9723,18 @@ nsFrame::RefreshSizeCache(nsBoxLayoutSta
metrics->mBlockMinSize.height = lineBounds.height;
count++;
} while(firstFrame);
} else {
metrics->mBlockMinSize.height = desiredSize.Height();
}
- metrics->mBlockPrefSize.height = metrics->mBlockMinSize.height;
+ metrics->mBlockPrefSize.height = std::max(desiredSize.Height(),
+ metrics->mBlockMinSize.height);
if (desiredSize.BlockStartAscent() ==
ReflowOutput::ASK_FOR_BASELINE) {
if (!nsLayoutUtils::GetFirstLineBaseline(wm, this,
&metrics->mBlockAscent))
metrics->mBlockAscent = GetLogicalBaseline(wm);
} else {
metrics->mBlockAscent = desiredSize.BlockStartAscent();