Removed some static functions that are no longer needed

git-svn-id: svn://10.0.0.236/trunk@23010 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-03-06 00:48:45 +00:00
parent 470d81fb75
commit b81fd87c6f
3 changed files with 8 additions and 166 deletions

View File

@@ -739,8 +739,11 @@ nsHTMLReflowState::InitConstraints(nsIPresContext& aPresContext)
NS_ASSERTION((computedMargin.right > -200000) &&
(computedMargin.right < 200000), "oy");
#endif
ComputeBorderFor(frame, mComputedBorderPadding);
ComputePadding(containingBlockWidth);
if (!mStyleSpacing->GetBorder(mComputedBorderPadding)) {
// CSS2 has no percentage borders
mComputedBorderPadding.SizeTo(0, 0, 0, 0);
}
mComputedBorderPadding += mComputedPadding;
nsStyleUnit widthUnit = mStylePosition->mWidth.GetUnit();
@@ -1305,79 +1308,6 @@ nsHTMLReflowState::ComputePadding(nscoord aContainingBlockWidth)
}
}
void
nsHTMLReflowState::ComputePaddingFor(nsIFrame* aFrame,
const nsReflowState* aParentRS,
nsMargin& aResult)
{
const nsStyleSpacing* spacing;
nsresult rv;
rv = aFrame->GetStyleData(eStyleStruct_Spacing,
(const nsStyleStruct*&) spacing);
if (NS_SUCCEEDED(rv) && (nsnull != spacing)) {
// If style can provide us the padding directly, then use it.
spacing->CalcPaddingFor(aFrame, aResult);
#if 0
if (!spacing->GetPadding(aResult) && (nsnull != aParentRS))
#else
spacing->CalcPaddingFor(aFrame, aResult);
if ((eStyleUnit_Percent == spacing->mPadding.GetTopUnit()) ||
(eStyleUnit_Percent == spacing->mPadding.GetRightUnit()) ||
(eStyleUnit_Percent == spacing->mPadding.GetBottomUnit()) ||
(eStyleUnit_Percent == spacing->mPadding.GetLeftUnit()))
#endif
{
// We have to compute the value (because it's uncomputable by
// the style code).
const nsHTMLReflowState* rs = GetContainingBlockReflowState(aParentRS);
if (nsnull != rs) {
nsStyleCoord left, right, top, bottom;
nscoord containingBlockWidth = rs->computedWidth;
ComputeHorizontalValue(containingBlockWidth, spacing->mPadding.GetLeftUnit(),
spacing->mPadding.GetLeft(left), aResult.left);
ComputeHorizontalValue(containingBlockWidth, spacing->mPadding.GetRightUnit(),
spacing->mPadding.GetRight(right),
aResult.right);
// According to the CSS2 spec, padding percentages are
// calculated with respect to the *width* of the containing
// block, even for padding-top and padding-bottom.
ComputeHorizontalValue(containingBlockWidth, spacing->mPadding.GetTopUnit(),
spacing->mPadding.GetTop(top), aResult.top);
ComputeHorizontalValue(containingBlockWidth, spacing->mPadding.GetBottomUnit(),
spacing->mPadding.GetBottom(bottom),
aResult.bottom);
}
else {
aResult.SizeTo(0, 0, 0, 0);
}
}
}
else {
aResult.SizeTo(0, 0, 0, 0);
}
}
void
nsHTMLReflowState::ComputeBorderFor(nsIFrame* aFrame,
nsMargin& aResult)
{
const nsStyleSpacing* spacing;
nsresult rv;
rv = aFrame->GetStyleData(eStyleStruct_Spacing,
(const nsStyleStruct*&) spacing);
if (NS_SUCCEEDED(rv) && (nsnull != spacing)) {
// If style can provide us the border directly, then use it.
if (!spacing->GetBorder(aResult)) {
// CSS2 has no percentage borders
aResult.SizeTo(0, 0, 0, 0);
}
}
else {
aResult.SizeTo(0, 0, 0, 0);
}
}
void
nsHTMLReflowState::ComputeBorderPaddingFor(nsIFrame* aFrame,
const nsReflowState* aParentRS,