Fix bug under some valid types of optimization where we cross margin and padding. b=420069 r+sr=roc a1.9b4=damons a-sheriff=sayrer

This commit is contained in:
dbaron@dbaron.org 2008-02-28 17:52:06 -08:00
Родитель 0418851452
Коммит 076aca1751
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -655,16 +655,16 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
const nsStylePadding *stylePadding = GetStylePadding(); const nsStylePadding *stylePadding = GetStylePadding();
const nsStyleBorder *styleBorder = GetStyleBorder(); const nsStyleBorder *styleBorder = GetStyleBorder();
const nsStyleMargin *styleMargin = GetStyleMargin(); const nsStyleMargin *styleMargin = GetStyleMargin();
nsStyleCoord tmp; nsStyleCoord marginCoord, paddingCoord;
// This goes at the beginning no matter how things are broken and how // This goes at the beginning no matter how things are broken and how
// messy the bidi situations are, since per CSS2.1 section 8.6 // messy the bidi situations are, since per CSS2.1 section 8.6
// (implemented in bug 328168), the startSide border is always on the // (implemented in bug 328168), the startSide border is always on the
// first line. // first line.
aData->currentLine += aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(startSide, tmp), 0) + GetCoord(stylePadding->mPadding.Get(startSide, paddingCoord), 0) +
styleBorder->GetBorderWidth(startSide) + styleBorder->GetBorderWidth(startSide) +
GetCoord(styleMargin->mMargin.Get(startSide, tmp), 0); GetCoord(styleMargin->mMargin.Get(startSide, marginCoord), 0);
const nsLineList_iterator* savedLine = aData->line; const nsLineList_iterator* savedLine = aData->line;
@ -692,9 +692,9 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// (implemented in bug 328168), the endSide border is always on the // (implemented in bug 328168), the endSide border is always on the
// last line. // last line.
aData->currentLine += aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(endSide, tmp), 0) + GetCoord(stylePadding->mPadding.Get(endSide, paddingCoord), 0) +
styleBorder->GetBorderWidth(endSide) + styleBorder->GetBorderWidth(endSide) +
GetCoord(styleMargin->mMargin.Get(endSide, tmp), 0); GetCoord(styleMargin->mMargin.Get(endSide, marginCoord), 0);
} }
/* virtual */ nsSize /* virtual */ nsSize