Added check for unconstrained width/height of the containing block when

computing 'offsets'
This commit is contained in:
troy%netscape.com 1999-01-23 04:49:15 +00:00
parent 6810e3ae38
commit 0a2d359c38
2 changed files with 44 additions and 0 deletions

View File

@ -248,6 +248,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
PRBool leftIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit();
PRBool rightIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetRightUnit();
// Check for percentage based values and an unconstrained containing
// block width. Treat them like 'auto'
if (NS_UNCONSTRAINEDSIZE == cbrs->computedWidth) {
if (eStyleUnit_Percent == aPosition->mOffset.GetLeftUnit()) {
leftIsAuto = PR_TRUE;
}
if (eStyleUnit_Percent == aPosition->mOffset.GetRightUnit()) {
rightIsAuto = PR_TRUE;
}
}
// If neither 'left' not 'right' are auto, then we're over-constrained and
// we ignore one of them
if (!leftIsAuto && !rightIsAuto) {
@ -301,6 +312,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
PRBool topIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetTopUnit();
PRBool bottomIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit();
// Check for percentage based values and a containing block height that
// depends on the content height. Treat them like 'auto'
if (NS_AUTOHEIGHT == cbrs->computedHeight) {
if (eStyleUnit_Percent == aPosition->mOffset.GetTopUnit()) {
topIsAuto = PR_TRUE;
}
if (eStyleUnit_Percent == aPosition->mOffset.GetBottomUnit()) {
bottomIsAuto = PR_TRUE;
}
}
// If neither is 'auto', 'bottom' is ignored
if (!topIsAuto && !bottomIsAuto) {
bottomIsAuto = PR_TRUE;

View File

@ -248,6 +248,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
PRBool leftIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit();
PRBool rightIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetRightUnit();
// Check for percentage based values and an unconstrained containing
// block width. Treat them like 'auto'
if (NS_UNCONSTRAINEDSIZE == cbrs->computedWidth) {
if (eStyleUnit_Percent == aPosition->mOffset.GetLeftUnit()) {
leftIsAuto = PR_TRUE;
}
if (eStyleUnit_Percent == aPosition->mOffset.GetRightUnit()) {
rightIsAuto = PR_TRUE;
}
}
// If neither 'left' not 'right' are auto, then we're over-constrained and
// we ignore one of them
if (!leftIsAuto && !rightIsAuto) {
@ -301,6 +312,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
PRBool topIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetTopUnit();
PRBool bottomIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit();
// Check for percentage based values and a containing block height that
// depends on the content height. Treat them like 'auto'
if (NS_AUTOHEIGHT == cbrs->computedHeight) {
if (eStyleUnit_Percent == aPosition->mOffset.GetTopUnit()) {
topIsAuto = PR_TRUE;
}
if (eStyleUnit_Percent == aPosition->mOffset.GetBottomUnit()) {
bottomIsAuto = PR_TRUE;
}
}
// If neither is 'auto', 'bottom' is ignored
if (!topIsAuto && !bottomIsAuto) {
bottomIsAuto = PR_TRUE;