fix border/padding and availableHeight calculations at page/column breaks, b=368079 r+sr=roc a=roc

This commit is contained in:
fantasai.cvs%inkedblade.net 2008-01-24 00:28:43 +00:00
Родитель a6e9acb5f5
Коммит f475f71935
4 изменённых файлов: 13 добавлений и 3 удалений

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

@ -1348,7 +1348,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Don't carry out a bottom margin when our height is fixed.
aMetrics.mCarriedOutBottomMargin.Zero();
}
else {
else if (NS_FRAME_IS_COMPLETE(aState.mReflowStatus)) {
nscoord autoHeight = aState.mY + nonCarriedOutVerticalMargin;
// Shrink wrap our height around our contents.
@ -1383,6 +1383,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
autoHeight += borderPadding.top + borderPadding.bottom;
aMetrics.height = autoHeight;
}
else {
NS_ASSERTION(aReflowState.availableHeight != NS_UNCONSTRAINEDSIZE,
"Shouldn't be incomplete if availableHeight is UNCONSTRAINED.");
aMetrics.height = PR_MAX(aState.mY, aReflowState.availableHeight);
}
if (IS_TRUE_OVERFLOW_CONTAINER(this) &&
NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)) {

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

@ -203,7 +203,7 @@ nsBlockReflowState::ComputeBlockAvailSpace(nsIFrame* aFrame,
aResult.y = mY;
aResult.height = GetFlag(BRS_UNCONSTRAINEDHEIGHT)
? NS_UNCONSTRAINEDSIZE
: PR_MAX(0, mBottomEdge - mY);
: PR_MAX(0, mReflowState.availableHeight - mY);
// mY might be greater than mBottomEdge if the block's top margin pushes
// it off the page/column. Negative available height can confuse other code
// and is nonsense in principle.

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

@ -372,7 +372,7 @@ fails == 352980-1h.html 352980-1-ref.html
== 367612-1e.html 367612-1-ref.html
== 367612-1f.html 367612-1-ref.html
!= 367612-1g.html 367612-1-ref.html
fails == 368020-1.html 368020-1-ref.html # bug 368079
== 368020-1.html 368020-1-ref.html
random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 368020-2.html 368020-2-ref.html # bug 368157 (gtk)
fails == 368020-3.html 368020-3-ref.html # bug 368085
fails == 368020-4.html 368020-4-ref.html # bug 368085

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

@ -5,3 +5,8 @@
== abspos-overflow-01.xhtml abspos-overflow-01.ref.xhtml
== abspos-overflow-01-cols.xhtml abspos-overflow-01-cols.ref.xhtml
== dynamic-abspos-overflow-01-cols.xhtml dynamic-abspos-overflow-01-cols.ref.xhtml
== border-breaking-000-cols.xhtml border-breaking-000-cols.ref.xhtml
== border-breaking-001-cols.xhtml border-breaking-001-cols.ref.xhtml
== border-breaking-002-cols.xhtml border-breaking-002-cols.ref.xhtml
== border-breaking-003-cols.xhtml border-breaking-003-cols.ref.xhtml
== border-breaking-004-cols.xhtml border-breaking-002-cols.ref.xhtml