From 4eab0af79469a041af0251713c89b7b2aaedabd9 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Fri, 15 Jan 1999 04:28:17 +0000 Subject: [PATCH] Fixed an assert that was getting hit for absolutely positioned elements git-svn-id: svn://10.0.0.236/trunk@17840 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsHTMLReflowState.cpp | 8 ++++++-- mozilla/layout/html/base/src/nsHTMLReflowState.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 36e225cc321..2d5f7e4f101 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -347,7 +347,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, // Initialize the 'top' and 'bottom' computed offsets PRBool bottomIsAuto = PR_FALSE; - if (eStyleUnit_Auto == aPosition->mOffset.GetTopUnit()) { + if ((eStyleUnit_Auto == aPosition->mOffset.GetTopUnit()) || + ((NS_AUTOHEIGHT == containingBlockHeight) && + (eStyleUnit_Percent == aPosition->mOffset.GetTopUnit()))) { // Use the placeholder position computedOffsets.top = placeholderOffset.y; } else { @@ -355,7 +357,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, ComputeVerticalValue(containingBlockHeight, aPosition->mOffset.GetTopUnit(), aPosition->mOffset.GetTop(coord), computedOffsets.top); } - if (eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit()) { + if ((eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit()) || + ((NS_AUTOHEIGHT == containingBlockHeight) && + (eStyleUnit_Percent == aPosition->mOffset.GetBottomUnit()))) { if (eStyleUnit_Auto == heightUnit) { computedOffsets.bottom = 0; } else { diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index 36e225cc321..2d5f7e4f101 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -347,7 +347,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, // Initialize the 'top' and 'bottom' computed offsets PRBool bottomIsAuto = PR_FALSE; - if (eStyleUnit_Auto == aPosition->mOffset.GetTopUnit()) { + if ((eStyleUnit_Auto == aPosition->mOffset.GetTopUnit()) || + ((NS_AUTOHEIGHT == containingBlockHeight) && + (eStyleUnit_Percent == aPosition->mOffset.GetTopUnit()))) { // Use the placeholder position computedOffsets.top = placeholderOffset.y; } else { @@ -355,7 +357,9 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, ComputeVerticalValue(containingBlockHeight, aPosition->mOffset.GetTopUnit(), aPosition->mOffset.GetTop(coord), computedOffsets.top); } - if (eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit()) { + if ((eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit()) || + ((NS_AUTOHEIGHT == containingBlockHeight) && + (eStyleUnit_Percent == aPosition->mOffset.GetBottomUnit()))) { if (eStyleUnit_Auto == heightUnit) { computedOffsets.bottom = 0; } else {