diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 723afa35fa21..d85f2dcbacd6 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -3541,9 +3541,11 @@ nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord) // font->mSize as the font size. Adjust for that. Also adjust for // the text zoom, if any. const nsStyleFont* font = GetStyleFont(); - aCoord = NSToCoordRound((float(aCoord) * - (float(font->mSize) / float(font->mFont.size))) / - mPresShell->GetPresContext()->TextZoom()); + float fCoord = float(aCoord) / mPresShell->GetPresContext()->TextZoom(); + if (font->mFont.size != font->mSize) { + fCoord = fCoord * (float(font->mSize) / float(font->mFont.size)); + } + aCoord = NSToCoordRound(fCoord); return true; }