#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

@@ -601,15 +601,9 @@ nsInlineFrame::ReflowFrames(nsIPresContext* aPresContext,
aMetrics.width += aReflowState.mComputedBorderPadding.right;
}
SetFontFromStyle(aReflowState.rendContext, mStyleContext);
nsCOMPtr<nsIFontMetrics> fm;
const nsStyleFont* font;
GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font);
if (font) {
aReflowState.rendContext->SetFont(font->mFont);
aReflowState.rendContext->GetFontMetrics(*getter_AddRefs(fm));
} else {
NS_WARNING("No font retrieved from style context - sorry but font metrics are not available");
}
aReflowState.rendContext->GetFontMetrics(*getter_AddRefs(fm));
if (fm) {
// Compute final height of the frame.
@@ -640,6 +634,8 @@ nsInlineFrame::ReflowFrames(nsIPresContext* aPresContext,
// little hack lets us override that behavior to allow for more
// precise layout in the face of imprecise fonts.
if (nsHTMLReflowState::UseComputedHeight()) {
const nsStyleFont* font;
GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font);
aMetrics.height = font->mFont.size +
aReflowState.mComputedBorderPadding.top +
aReflowState.mComputedBorderPadding.bottom;