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

HTML reflow state
This commit is contained in:
troy%netscape.com 1999-03-06 01:40:29 +00:00
Родитель 0410405922
Коммит 756524925c
8 изменённых файлов: 12 добавлений и 44 удалений

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

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

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

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

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

@ -421,9 +421,6 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext,
nscoord containingBlockWidth, nscoord containingBlockWidth,
nscoord containingBlockHeight) 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 // If any of the offsets are 'auto', then get the placeholder frame
// and compute its origin relative to the containing block // and compute its origin relative to the containing block
nsPoint placeholderOffset(0, 0); nsPoint placeholderOffset(0, 0);

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

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

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

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

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

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

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

@ -421,9 +421,6 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext,
nscoord containingBlockWidth, nscoord containingBlockWidth,
nscoord containingBlockHeight) 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 // If any of the offsets are 'auto', then get the placeholder frame
// and compute its origin relative to the containing block // and compute its origin relative to the containing block
nsPoint placeholderOffset(0, 0); nsPoint placeholderOffset(0, 0);

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

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