#142562 problem with <td align=right or align=center

We are observing langGroup in some place while ignor it in others. This patch
make all font metrics call consistent. nsIRenderingContext API is change to
make things neat.
r=rbs, sr=waterson


git-svn-id: svn://10.0.0.236/trunk@122131 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
shanjian%netscape.com
2002-05-24 20:11:14 +00:00
parent 2f838a3f76
commit a9c700ad59
54 changed files with 168 additions and 190 deletions

View File

@@ -2378,7 +2378,7 @@ nsHTMLReflowState::CalcLineHeight(nsIPresContext* aPresContext,
lineHeight = font->mFont.size;
}
else {
aRenderingContext->SetFont(font->mFont);
SetFontFromStyle(aRenderingContext, sc);
nsCOMPtr<nsIFontMetrics> fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
#ifdef NEW_FONT_HEIGHT_APIS
@@ -2416,21 +2416,9 @@ nsHTMLReflowState::ComputeHorizontalValue(nscoord aContainingBlockWidth,
// pretend its zero...
}
else {
const nsStyleFont* font;
frame->GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&) font);
const nsStyleVisibility* vis;
frame->GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
nsCOMPtr<nsIDeviceContext> deviceContext;
rendContext->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));
rendContext->SetFont(fm);
nsCOMPtr<nsIStyleContext> styleContext;
frame->GetStyleContext(getter_AddRefs(styleContext));
SetFontFromStyle(rendContext, styleContext);
nscoord fontWidth;
rendContext->GetWidth('M', fontWidth);
aResult = aCoord.GetIntValue() * fontWidth;