Implement CSS2.1 10.3.7, shrink-to-fit for abs.pos. elements. b=201897 r=bzbarsky sr=dbaron

This commit is contained in:
mats.palmgren@bredband.net
2004-11-26 23:28:09 +00:00
parent ca39724482
commit cd7a49eb7f
4 changed files with 296 additions and 202 deletions

View File

@@ -1100,20 +1100,8 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsPresContext* aPresContext,
// For a replaced element we use the intrinsic size
mComputedWidth = NS_INTRINSICSIZE;
} else {
// The width is shrink-to-fit but constrained by the containing block width
// The width is shrink-to-fit
mComputedWidth = NS_SHRINKWRAPWIDTH;
PRInt32 maxWidth = containingBlockWidth;
if (NS_UNCONSTRAINEDSIZE != maxWidth) {
maxWidth -= mComputedOffsets.left + mComputedMargin.left + mComputedBorderPadding.left +
mComputedBorderPadding.right + mComputedMargin.right + mComputedOffsets.right;
}
if (maxWidth <= 0) {
maxWidth = 1;
}
if (mComputedMaxWidth > maxWidth) {
mComputedMaxWidth = maxWidth;
}
}
if (leftIsAuto) {