From b6e15b0ec76d30920517d3f244a871ad882a281a Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 5 Jan 2004 23:48:57 +0000 Subject: [PATCH] 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 --- layout/generic/nsHTMLReflowState.cpp | 18 ++++++++++-------- layout/html/base/src/nsHTMLReflowState.cpp | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 335ea1f42af..3ad4284ab76 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -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); diff --git a/layout/html/base/src/nsHTMLReflowState.cpp b/layout/html/base/src/nsHTMLReflowState.cpp index 335ea1f42af..3ad4284ab76 100644 --- a/layout/html/base/src/nsHTMLReflowState.cpp +++ b/layout/html/base/src/nsHTMLReflowState.cpp @@ -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);