Eliminated some code that's no longer needed now that the info is in the

HTML reflow state


git-svn-id: svn://10.0.0.236/trunk@23026 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-03-06 01:40:29 +00:00
parent da3ad2f309
commit cd506df1a1
8 changed files with 12 additions and 44 deletions

View File

@@ -520,12 +520,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
if (floaterYMost > 0) {
// What we need to check for is if the bottom most floater extends below
// the content area of the desired size
nsMargin borderPadding;
nscoord contentYMost;
nsHTMLReflowState::ComputeBorderPaddingFor(this, aReflowState.parentReflowState,
borderPadding);
contentYMost = aDesiredSize.height - borderPadding.bottom;
nscoord contentYMost = aDesiredSize.height -
aReflowState.mComputedBorderPadding.bottom;
if (floaterYMost > contentYMost) {
aDesiredSize.height += floaterYMost - contentYMost;
@@ -623,18 +619,14 @@ nsAreaFrame::ReflowAbsoluteFrame(nsIPresContext& aPresContext,
kidReflowState.reason = eReflowReason_Initial;
}
// XXX Temporary hack until the block/inline code starts using 'computedWidth'
kidReflowState.availableWidth = kidReflowState.computedWidth;
rv = htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
// XXX If the child had a fixed height, then make sure it respected it...
if (NS_AUTOHEIGHT != kidReflowState.computedHeight) {
if (kidDesiredSize.height < kidReflowState.computedHeight) {
kidDesiredSize.height = kidReflowState.computedHeight;
nsMargin borderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, borderPadding);
kidDesiredSize.height += borderPadding.top + borderPadding.bottom;
kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top +
kidReflowState.mComputedBorderPadding.bottom;
}
}

View File

@@ -412,10 +412,7 @@ nsBulletFrame::Reflow(nsIPresContext& aPresContext,
// Add in the border and padding; split the top/bottom between the
// ascent and descent to make things look nice
nsMargin borderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(this,
aReflowState.parentReflowState,
borderPadding);
const nsMargin& borderPadding = aReflowState.mComputedBorderPadding;
aMetrics.width += borderPadding.left + borderPadding.right;
aMetrics.height += borderPadding.top + borderPadding.bottom;
aMetrics.ascent += borderPadding.top;

View File

@@ -421,9 +421,6 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext,
nscoord containingBlockWidth,
nscoord containingBlockHeight)
{
// XXX Correctly handle absolutely positioned elements by using the
// correct edge (computed width/height is the content edge)...
// If any of the offsets are 'auto', then get the placeholder frame
// and compute its origin relative to the containing block
nsPoint placeholderOffset(0, 0);

View File

@@ -93,9 +93,7 @@ nsLeafFrame::AddBordersAndPadding(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics,
nsMargin& aBorderPadding)
{
nsHTMLReflowState::ComputeBorderPaddingFor(this,
aReflowState.parentReflowState,
aBorderPadding);
aBorderPadding = aReflowState.mComputedBorderPadding;
aMetrics.width += aBorderPadding.left + aBorderPadding.right;
aMetrics.height += aBorderPadding.top + aBorderPadding.bottom;
aMetrics.ascent = aMetrics.height;

View File

@@ -520,12 +520,8 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
if (floaterYMost > 0) {
// What we need to check for is if the bottom most floater extends below
// the content area of the desired size
nsMargin borderPadding;
nscoord contentYMost;
nsHTMLReflowState::ComputeBorderPaddingFor(this, aReflowState.parentReflowState,
borderPadding);
contentYMost = aDesiredSize.height - borderPadding.bottom;
nscoord contentYMost = aDesiredSize.height -
aReflowState.mComputedBorderPadding.bottom;
if (floaterYMost > contentYMost) {
aDesiredSize.height += floaterYMost - contentYMost;
@@ -623,18 +619,14 @@ nsAreaFrame::ReflowAbsoluteFrame(nsIPresContext& aPresContext,
kidReflowState.reason = eReflowReason_Initial;
}
// XXX Temporary hack until the block/inline code starts using 'computedWidth'
kidReflowState.availableWidth = kidReflowState.computedWidth;
rv = htmlReflow->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
// XXX If the child had a fixed height, then make sure it respected it...
if (NS_AUTOHEIGHT != kidReflowState.computedHeight) {
if (kidDesiredSize.height < kidReflowState.computedHeight) {
kidDesiredSize.height = kidReflowState.computedHeight;
nsMargin borderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(aKidFrame, &aReflowState, borderPadding);
kidDesiredSize.height += borderPadding.top + borderPadding.bottom;
kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top +
kidReflowState.mComputedBorderPadding.bottom;
}
}

View File

@@ -412,10 +412,7 @@ nsBulletFrame::Reflow(nsIPresContext& aPresContext,
// Add in the border and padding; split the top/bottom between the
// ascent and descent to make things look nice
nsMargin borderPadding;
nsHTMLReflowState::ComputeBorderPaddingFor(this,
aReflowState.parentReflowState,
borderPadding);
const nsMargin& borderPadding = aReflowState.mComputedBorderPadding;
aMetrics.width += borderPadding.left + borderPadding.right;
aMetrics.height += borderPadding.top + borderPadding.bottom;
aMetrics.ascent += borderPadding.top;

View File

@@ -421,9 +421,6 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext,
nscoord containingBlockWidth,
nscoord containingBlockHeight)
{
// XXX Correctly handle absolutely positioned elements by using the
// correct edge (computed width/height is the content edge)...
// If any of the offsets are 'auto', then get the placeholder frame
// and compute its origin relative to the containing block
nsPoint placeholderOffset(0, 0);

View File

@@ -93,9 +93,7 @@ nsLeafFrame::AddBordersAndPadding(nsIPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics,
nsMargin& aBorderPadding)
{
nsHTMLReflowState::ComputeBorderPaddingFor(this,
aReflowState.parentReflowState,
aBorderPadding);
aBorderPadding = aReflowState.mComputedBorderPadding;
aMetrics.width += aBorderPadding.left + aBorderPadding.right;
aMetrics.height += aBorderPadding.top + aBorderPadding.bottom;
aMetrics.ascent = aMetrics.height;