When dealing with a percentage-width HR, don't let it impact the max-element-size.width inappropriately

This commit is contained in:
kipp%netscape.com 1998-12-11 22:23:18 +00:00
parent 50844df3ca
commit 47761f83d7

View File

@ -228,7 +228,16 @@ HRuleFrame::Reflow(nsIPresContext& aPresContext,
aPresContext.GetScaledPixelsToTwips(p2t);
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
if (aReflowState.HaveFixedContentWidth()) {
aDesiredSize.maxElementSize->width = aReflowState.minWidth;
const nsStylePosition* pos;
GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)pos);
if (eStyleUnit_Percent == pos->mWidth.GetUnit()) {
// When the HR is using a percentage width, make sure it
// remains springy.
aDesiredSize.maxElementSize->width = onePixel;
}
else {
aDesiredSize.maxElementSize->width = aReflowState.minWidth;
}
aDesiredSize.maxElementSize->height = onePixel;
}
else {