nsIStyleContext* aStyleContext)
nsStyleContext* aStyleContext)
ComputeLineHeight(nsIPresContext* aPresContext,                  nsIRenderingContext* aRenderingContext,                  nsIStyleContext* aStyleContext){  NS_PRECONDITION(nsnull != aRenderingContext, "no rendering context");  nscoord lineHeight = -1;  const nsStyleText* text;  GetStyleData(aStyleContext, &text);  const nsStyleFont* font;  GetStyleData(aStyleContext, &font);  const nsStyleVisibility* vis;  GetStyleData(aStyleContext, &vis);    nsStyleUnit unit = text->mLineHeight.GetUnit();  if (unit == eStyleUnit_Coord) {    // For length values just use the pre-computed value    lineHeight = text->mLineHeight.GetCoordValue();  } else {    nsCOMPtr<nsIDeviceContext> deviceContext;    aRenderingContext->GetDeviceContext(*getter_AddRefs(deviceContext));    nsCOMPtr<nsIAtom> langGroup;    if (vis->mLanguage) {      vis->mLanguage->GetLanguageGroup(getter_AddRefs(langGroup));    }    nsCOMPtr<nsIFontMetrics> fm;    deviceContext->GetMetricsFor(font->mFont, langGroup, *getter_AddRefs(fm));    if (unit == eStyleUnit_Factor) {      // For factor units the computed value of the line-height property       // is found by multiplying the factor by the font's <b>actual</b>       // em height.       float factor;      factor = text->mLineHeight.GetFactorValue();      // Note: we normally use the actual font height for computing the      // line-height raw value from the style context. On systems where      // they disagree the actual font height is more appropriate. This      // little hack lets us override that behavior to allow for more      // precise layout in the face of imprecise fonts.      nscoord emHeight = font->mFont.size;      if (!nsHTMLReflowState::UseComputedHeight()) {        fm->GetEmHeight(emHeight);      }      lineHeight = NSToCoordRound(factor * emHeight);    } else {      NS_ASSERTION(eStyleUnit_Normal == unit, "bad unit");      lineHeight = font->mFont.size;      if (!nsHTMLReflowState::UseComputedHeight()) {        lineHeight = GetNormalLineHeight(fm);      }    }  }  return lineHeight;}