Bug 186485. The nsLineBox maximum-width includes the block's left border-padding but not the right. r+sr=roc,a=asa,patch by Hideo Saito

This commit is contained in:
roc+%cs.cmu.edu 2005-06-20 03:42:19 +00:00
Родитель 6a05d2986b
Коммит 68b56bc54b
3 изменённых файлов: 8 добавлений и 2 удалений

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

@ -1454,7 +1454,8 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
aMetrics.mMaximumWidth = aMetrics.width;
} else {
// We need to add in for the right border/padding
// XXXldb Why right and not left?
// The maximum width in the reflow state includes the left
// border/padding but not the right.
aMetrics.mMaximumWidth = aState.mMaximumWidth + borderPadding.right;
}
#ifdef NOISY_MAXIMUM_WIDTH
@ -3568,7 +3569,9 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
// If we asked the block to update its maximum width, then record the
// updated value in the line, and update the current maximum width
if (aState.GetFlag(BRS_COMPUTEMAXWIDTH)) {
aLine->mMaximumWidth = brc.GetMaximumWidth();
// The maximum width in the line box includes the left
// border/padding of this block, but not the right.
aLine->mMaximumWidth = brc.GetMaximumWidth() + availSpace.x;
aState.UpdateMaximumWidth(aLine->mMaximumWidth);
}
PostPlaceLine(aState, aLine, maxElementWidth);

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

@ -245,6 +245,8 @@ public:
nsFloatCacheFreeList mBelowCurrentLineFloats;
nscoord mMaxElementWidth;
// maximum width includes the left border/padding but not the right
nscoord mMaximumWidth;
nscoord mMinLineHeight;

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

@ -451,6 +451,7 @@ public:
nsRect mBounds;
nscoord mMaxElementWidth; // width part of max-element-size
nscoord mMaximumWidth; // maximum width (needed for incremental reflow of tables)
// includes the left border/padding but not the right
struct FlagBits {
PRUint32 mDirty : 1;