else if (eStyleUnit_Chars == aUnit) { if ((nsnull == rendContext) || (nsnull == frame)) {   } else { const nsStyleFont* font; frame->GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&) font); rendContext->SetFont(font->mFont); nscoord fontWidth; rendContext->GetWidth('M', fontWidth); aResult = aCoord.GetIntValue() * fontWidth; } }
nsHTMLReflowState::ComputeHorizontalValue(nscoord aContainingBlockWidth,                                          nsStyleUnit aUnit,                                          const nsStyleCoord& aCoord,                                          nscoord& aResult){  NS_PRECONDITION(eStyleUnit_Inherit != aUnit, "unexpected unit");  aResult = 0;  if (eStyleUnit_Percent == aUnit) {    if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) {      aResult = 0;    } else {      float pct = aCoord.GetPercentValue();      aResult = NSToCoordFloor(aContainingBlockWidth * pct);    }    } else if (eStyleUnit_Coord == aUnit) {    aResult = aCoord.GetCoordValue();  }  else if (eStyleUnit_Chars == aUnit) {    if ((nsnull == rendContext) || (nsnull == frame)) {      // We can't compute it without a rendering context or frame, so      // pretend its zero...    }    else {      const nsStyleFont* font;      frame->GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&) font);      rendContext->SetFont(font->mFont);      nscoord fontWidth;      rendContext->GetWidth('M', fontWidth);      aResult = aCoord.GetIntValue() * fontWidth;    }  }}