Made sure to set previous bottom margin when restoring reflow state

This commit is contained in:
troy 1998-05-03 04:37:56 +00:00
Родитель 855a687477
Коммит 7b7acfc81c
6 изменённых файлов: 78 добавлений и 36 удалений

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

@ -1253,18 +1253,25 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsLineData* prevLine = lastLine->mPrevLine; nsLineData* prevLine = lastLine->mPrevLine;
state.mY = prevLine->mBounds.YMost(); state.mY = prevLine->mBounds.YMost();
if (!state.mUnconstrainedHeight) { if (!state.mUnconstrainedHeight) {
state.mAvailSize.height -= state.mY; state.mAvailSize.height -= state.mY;
} }
// XXX This isn't really right...
state.mKidXMost = mRect.XMost(); state.mKidXMost = mRect.XMost();
#if 0 // If the previous line is a block, then factor in its bottom margin
// XXX Set this... if (prevLine->mIsBlock) {
state.mPrevMaxNegBottomMargin = ?; nsStyleSpacing* spacing;
state.mPrevMaxPosBottomMargin = ?; nsIFrame* kid = prevLine->mFirstChild;
#endif
kid->GetStyleData(kStyleSpacingSID, (nsStyleStruct*&)spacing);
if (spacing->mMargin.bottom < 0) {
state.mPrevMaxNegBottomMargin = -spacing->mMargin.bottom;
} else {
state.mPrevMaxPosBottomMargin = spacing->mMargin.bottom;
}
}
} }
// Reflow unmapped children // Reflow unmapped children

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

@ -1253,18 +1253,25 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsLineData* prevLine = lastLine->mPrevLine; nsLineData* prevLine = lastLine->mPrevLine;
state.mY = prevLine->mBounds.YMost(); state.mY = prevLine->mBounds.YMost();
if (!state.mUnconstrainedHeight) { if (!state.mUnconstrainedHeight) {
state.mAvailSize.height -= state.mY; state.mAvailSize.height -= state.mY;
} }
// XXX This isn't really right...
state.mKidXMost = mRect.XMost(); state.mKidXMost = mRect.XMost();
#if 0 // If the previous line is a block, then factor in its bottom margin
// XXX Set this... if (prevLine->mIsBlock) {
state.mPrevMaxNegBottomMargin = ?; nsStyleSpacing* spacing;
state.mPrevMaxPosBottomMargin = ?; nsIFrame* kid = prevLine->mFirstChild;
#endif
kid->GetStyleData(kStyleSpacingSID, (nsStyleStruct*&)spacing);
if (spacing->mMargin.bottom < 0) {
state.mPrevMaxNegBottomMargin = -spacing->mMargin.bottom;
} else {
state.mPrevMaxPosBottomMargin = spacing->mMargin.bottom;
}
}
} }
// Reflow unmapped children // Reflow unmapped children

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

@ -1253,18 +1253,25 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsLineData* prevLine = lastLine->mPrevLine; nsLineData* prevLine = lastLine->mPrevLine;
state.mY = prevLine->mBounds.YMost(); state.mY = prevLine->mBounds.YMost();
if (!state.mUnconstrainedHeight) { if (!state.mUnconstrainedHeight) {
state.mAvailSize.height -= state.mY; state.mAvailSize.height -= state.mY;
} }
// XXX This isn't really right...
state.mKidXMost = mRect.XMost(); state.mKidXMost = mRect.XMost();
#if 0 // If the previous line is a block, then factor in its bottom margin
// XXX Set this... if (prevLine->mIsBlock) {
state.mPrevMaxNegBottomMargin = ?; nsStyleSpacing* spacing;
state.mPrevMaxPosBottomMargin = ?; nsIFrame* kid = prevLine->mFirstChild;
#endif
kid->GetStyleData(kStyleSpacingSID, (nsStyleStruct*&)spacing);
if (spacing->mMargin.bottom < 0) {
state.mPrevMaxNegBottomMargin = -spacing->mMargin.bottom;
} else {
state.mPrevMaxPosBottomMargin = spacing->mMargin.bottom;
}
}
} }
// Reflow unmapped children // Reflow unmapped children

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

@ -1253,18 +1253,25 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsLineData* prevLine = lastLine->mPrevLine; nsLineData* prevLine = lastLine->mPrevLine;
state.mY = prevLine->mBounds.YMost(); state.mY = prevLine->mBounds.YMost();
if (!state.mUnconstrainedHeight) { if (!state.mUnconstrainedHeight) {
state.mAvailSize.height -= state.mY; state.mAvailSize.height -= state.mY;
} }
// XXX This isn't really right...
state.mKidXMost = mRect.XMost(); state.mKidXMost = mRect.XMost();
#if 0 // If the previous line is a block, then factor in its bottom margin
// XXX Set this... if (prevLine->mIsBlock) {
state.mPrevMaxNegBottomMargin = ?; nsStyleSpacing* spacing;
state.mPrevMaxPosBottomMargin = ?; nsIFrame* kid = prevLine->mFirstChild;
#endif
kid->GetStyleData(kStyleSpacingSID, (nsStyleStruct*&)spacing);
if (spacing->mMargin.bottom < 0) {
state.mPrevMaxNegBottomMargin = -spacing->mMargin.bottom;
} else {
state.mPrevMaxPosBottomMargin = spacing->mMargin.bottom;
}
}
} }
// Reflow unmapped children // Reflow unmapped children

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

@ -1253,18 +1253,25 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsLineData* prevLine = lastLine->mPrevLine; nsLineData* prevLine = lastLine->mPrevLine;
state.mY = prevLine->mBounds.YMost(); state.mY = prevLine->mBounds.YMost();
if (!state.mUnconstrainedHeight) { if (!state.mUnconstrainedHeight) {
state.mAvailSize.height -= state.mY; state.mAvailSize.height -= state.mY;
} }
// XXX This isn't really right...
state.mKidXMost = mRect.XMost(); state.mKidXMost = mRect.XMost();
#if 0 // If the previous line is a block, then factor in its bottom margin
// XXX Set this... if (prevLine->mIsBlock) {
state.mPrevMaxNegBottomMargin = ?; nsStyleSpacing* spacing;
state.mPrevMaxPosBottomMargin = ?; nsIFrame* kid = prevLine->mFirstChild;
#endif
kid->GetStyleData(kStyleSpacingSID, (nsStyleStruct*&)spacing);
if (spacing->mMargin.bottom < 0) {
state.mPrevMaxNegBottomMargin = -spacing->mMargin.bottom;
} else {
state.mPrevMaxPosBottomMargin = spacing->mMargin.bottom;
}
}
} }
// Reflow unmapped children // Reflow unmapped children

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

@ -1253,18 +1253,25 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsLineData* prevLine = lastLine->mPrevLine; nsLineData* prevLine = lastLine->mPrevLine;
state.mY = prevLine->mBounds.YMost(); state.mY = prevLine->mBounds.YMost();
if (!state.mUnconstrainedHeight) { if (!state.mUnconstrainedHeight) {
state.mAvailSize.height -= state.mY; state.mAvailSize.height -= state.mY;
} }
// XXX This isn't really right...
state.mKidXMost = mRect.XMost(); state.mKidXMost = mRect.XMost();
#if 0 // If the previous line is a block, then factor in its bottom margin
// XXX Set this... if (prevLine->mIsBlock) {
state.mPrevMaxNegBottomMargin = ?; nsStyleSpacing* spacing;
state.mPrevMaxPosBottomMargin = ?; nsIFrame* kid = prevLine->mFirstChild;
#endif
kid->GetStyleData(kStyleSpacingSID, (nsStyleStruct*&)spacing);
if (spacing->mMargin.bottom < 0) {
state.mPrevMaxNegBottomMargin = -spacing->mMargin.bottom;
} else {
state.mPrevMaxPosBottomMargin = spacing->mMargin.bottom;
}
}
} }
// Reflow unmapped children // Reflow unmapped children