bug 127022 - make sure the desired width is at least as big as the max element width. sr=kin, r=alexsavulov

This commit is contained in:
karnaze%netscape.com 2002-06-19 23:16:33 +00:00
Родитель 4df112e093
Коммит fcf58cc094
3 изменённых файлов: 37 добавлений и 14 удалений

Просмотреть файл

@ -1064,13 +1064,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.ascent += kidSize.ascent;
aDesiredSize.descent += kidSize.descent;
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
aDesiredSize.mMaximumWidth = kidSize.mMaximumWidth;
if (NS_UNCONSTRAINEDSIZE != aDesiredSize.mMaximumWidth) {
aDesiredSize.mMaximumWidth += leftInset + rightInset;
aDesiredSize.mMaximumWidth = nsTableFrame::RoundToPixel(aDesiredSize.mMaximumWidth, p2t);
}
}
if (aDesiredSize.maxElementSize) {
*aDesiredSize.maxElementSize = *pMaxElementSize;
if ((0 != pMaxElementSize->height) && (NS_UNCONSTRAINEDSIZE != pMaxElementSize->height)) {
@ -1083,6 +1076,17 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize->width = nsTableFrame::RoundToPixel(aDesiredSize.maxElementSize->width, p2t);
}
}
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
aDesiredSize.mMaximumWidth = kidSize.mMaximumWidth;
if (NS_UNCONSTRAINEDSIZE != aDesiredSize.mMaximumWidth) {
aDesiredSize.mMaximumWidth += leftInset + rightInset;
aDesiredSize.mMaximumWidth = nsTableFrame::RoundToPixel(aDesiredSize.mMaximumWidth, p2t);
}
// make sure the preferred width is at least as big as the max element width
if (aDesiredSize.maxElementSize) {
aDesiredSize.mMaximumWidth = PR_MAX(aDesiredSize.mMaximumWidth, aDesiredSize.maxElementSize->width);
}
}
if (aReflowState.mFlags.mSpecialHeightReflow) {
if (aDesiredSize.height > mRect.height) {

Просмотреть файл

@ -0,0 +1,15 @@
<html>
<body>
click on the go button and it should not move<BR>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="25%">x</td>
<td>
<nobr>
<input type="submit" value="Go!">
</nobr>
</td>
</tr>
</table>
</body>
</html>

Просмотреть файл

@ -1064,13 +1064,6 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.ascent += kidSize.ascent;
aDesiredSize.descent += kidSize.descent;
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
aDesiredSize.mMaximumWidth = kidSize.mMaximumWidth;
if (NS_UNCONSTRAINEDSIZE != aDesiredSize.mMaximumWidth) {
aDesiredSize.mMaximumWidth += leftInset + rightInset;
aDesiredSize.mMaximumWidth = nsTableFrame::RoundToPixel(aDesiredSize.mMaximumWidth, p2t);
}
}
if (aDesiredSize.maxElementSize) {
*aDesiredSize.maxElementSize = *pMaxElementSize;
if ((0 != pMaxElementSize->height) && (NS_UNCONSTRAINEDSIZE != pMaxElementSize->height)) {
@ -1083,6 +1076,17 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize->width = nsTableFrame::RoundToPixel(aDesiredSize.maxElementSize->width, p2t);
}
}
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
aDesiredSize.mMaximumWidth = kidSize.mMaximumWidth;
if (NS_UNCONSTRAINEDSIZE != aDesiredSize.mMaximumWidth) {
aDesiredSize.mMaximumWidth += leftInset + rightInset;
aDesiredSize.mMaximumWidth = nsTableFrame::RoundToPixel(aDesiredSize.mMaximumWidth, p2t);
}
// make sure the preferred width is at least as big as the max element width
if (aDesiredSize.maxElementSize) {
aDesiredSize.mMaximumWidth = PR_MAX(aDesiredSize.mMaximumWidth, aDesiredSize.maxElementSize->width);
}
}
if (aReflowState.mFlags.mSpecialHeightReflow) {
if (aDesiredSize.height > mRect.height) {