Removed HaveFixedContent* methods from nsHTMLReflowState and updated code to match (fix bug #7993)

git-svn-id: svn://10.0.0.236/trunk@38572 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1999-07-07 02:33:17 +00:00
parent 30105c46f8
commit 1b24c1974d
21 changed files with 5626 additions and 5509 deletions

View File

@@ -1236,6 +1236,37 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext,
return rv;
}
static PRBool
HaveAutoWidth(const nsHTMLReflowState& aReflowState)
{
if (NS_UNCONSTRAINEDSIZE == aReflowState.computedWidth) {
return PR_TRUE;
}
const nsStylePosition* pos = aReflowState.mStylePosition;
if (!pos) {
return PR_TRUE;
}
for (;;) {
nsStyleUnit widthUnit = pos->mWidth.GetUnit();
if (eStyleUnit_Auto == widthUnit) {
return PR_TRUE;
}
if (eStyleUnit_Inherit != widthUnit) {
break;
}
const nsHTMLReflowState* prs = (const nsHTMLReflowState*)
aReflowState.parentReflowState;
if (!prs) {
return PR_TRUE;
}
pos = prs->mStylePosition;
if (!pos) {
return PR_TRUE;
}
}
return PR_FALSE;
}
void
nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
nsBlockReflowState& aState,
@@ -1276,7 +1307,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
// Compute final width
nscoord maxWidth = 0, maxHeight = 0;
nscoord minWidth = aState.mKidXMost + borderPadding.right;
if (!aState.mUnconstrainedWidth && aReflowState.HaveFixedContentWidth()) {
if (!HaveAutoWidth(aReflowState)) {
// Use style defined width
aMetrics.width = borderPadding.left + aReflowState.computedWidth +
borderPadding.right;