Bug 842128 - Don't call nsLayoutUtils::GetFontMetricsForFrame in nsProgressFrame::ComputeAutoSize. r=dbaron.

This commit is contained in:
Jonathan Watt 2013-02-19 12:48:46 +00:00
parent 22fc7b9770
commit 7b2e2416d3

View File

@ -236,15 +236,10 @@ nsProgressFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
nsSize aMargin, nsSize aBorder,
nsSize aPadding, bool aShrinkWrap)
{
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
nsRefPtr<nsFontMetrics> fontMet;
NS_ENSURE_SUCCESS(nsLayoutUtils::GetFontMetricsForFrame(this,
getter_AddRefs(fontMet),
inflation),
nsSize(0, 0));
nsSize autoSize;
autoSize.height = autoSize.width = fontMet->Font().size; // 1em
autoSize.height = autoSize.width =
NSToCoordRound(StyleFont()->mFont.size *
nsLayoutUtils::FontSizeInflationFor(this)); // 1em
if (StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL) {
autoSize.height *= 10; // 10em