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
parent 9f9860b620
commit bd6e613fb1
2 changed files with 20 additions and 16 deletions

View File

@ -1627,14 +1627,6 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
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
nsFrame::ListTag(stdout, frame); printf(": cb=");
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
ComputeMinMaxValues(aContainingBlockWidth, aContainingBlockHeight, cbrs);

View File

@ -1627,14 +1627,6 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
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
nsFrame::ListTag(stdout, frame); printf(": cb=");
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
ComputeMinMaxValues(aContainingBlockWidth, aContainingBlockHeight, cbrs);