Calculate the relative offsets after we've done whatever corrections we need to

do to the CB height (eg in quirks mode).  Bug 226954, r+sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2004-01-05 23:48:57 +00:00
Родитель 3adb94642b
Коммит b6e15b0ec7
2 изменённых файлов: 20 добавлений и 16 удалений

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

@ -1627,14 +1627,6 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
aContainingBlockHeight); aContainingBlockHeight);
} }
// See if the element is relatively positioned
if (NS_STYLE_POSITION_RELATIVE == mStyleDisplay->mPosition) {
ComputeRelativeOffsets(cbrs, aContainingBlockWidth, aContainingBlockHeight);
} else {
// Initialize offsets to 0
mComputedOffsets.SizeTo(0, 0, 0, 0);
}
#if 0 #if 0
nsFrame::ListTag(stdout, frame); printf(": cb="); nsFrame::ListTag(stdout, frame); printf(": cb=");
nsFrame::ListTag(stdout, cbrs->frame); printf(" size=%d,%d\n", aContainingBlockWidth, aContainingBlockHeight); nsFrame::ListTag(stdout, cbrs->frame); printf(" size=%d,%d\n", aContainingBlockWidth, aContainingBlockHeight);
@ -1746,6 +1738,16 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
} }
} }
// Compute our offsets if the element is relatively positioned. We need
// the correct containing block width and height here, which is why we need
// to do it after all the quirks-n-such above.
if (NS_STYLE_POSITION_RELATIVE == mStyleDisplay->mPosition) {
ComputeRelativeOffsets(cbrs, aContainingBlockWidth, aContainingBlockHeight);
} else {
// Initialize offsets to 0
mComputedOffsets.SizeTo(0, 0, 0, 0);
}
// Calculate the computed values for min and max properties // Calculate the computed values for min and max properties
ComputeMinMaxValues(aContainingBlockWidth, aContainingBlockHeight, cbrs); ComputeMinMaxValues(aContainingBlockWidth, aContainingBlockHeight, cbrs);

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

@ -1627,14 +1627,6 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
aContainingBlockHeight); aContainingBlockHeight);
} }
// See if the element is relatively positioned
if (NS_STYLE_POSITION_RELATIVE == mStyleDisplay->mPosition) {
ComputeRelativeOffsets(cbrs, aContainingBlockWidth, aContainingBlockHeight);
} else {
// Initialize offsets to 0
mComputedOffsets.SizeTo(0, 0, 0, 0);
}
#if 0 #if 0
nsFrame::ListTag(stdout, frame); printf(": cb="); nsFrame::ListTag(stdout, frame); printf(": cb=");
nsFrame::ListTag(stdout, cbrs->frame); printf(" size=%d,%d\n", aContainingBlockWidth, aContainingBlockHeight); nsFrame::ListTag(stdout, cbrs->frame); printf(" size=%d,%d\n", aContainingBlockWidth, aContainingBlockHeight);
@ -1746,6 +1738,16 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
} }
} }
// Compute our offsets if the element is relatively positioned. We need
// the correct containing block width and height here, which is why we need
// to do it after all the quirks-n-such above.
if (NS_STYLE_POSITION_RELATIVE == mStyleDisplay->mPosition) {
ComputeRelativeOffsets(cbrs, aContainingBlockWidth, aContainingBlockHeight);
} else {
// Initialize offsets to 0
mComputedOffsets.SizeTo(0, 0, 0, 0);
}
// Calculate the computed values for min and max properties // Calculate the computed values for min and max properties
ComputeMinMaxValues(aContainingBlockWidth, aContainingBlockHeight, cbrs); ComputeMinMaxValues(aContainingBlockWidth, aContainingBlockHeight, cbrs);