bug 55545 - set the table preferred width during an unconstrained reflow. Return the preferred width as the maximum width when requested in the outer table reflow. a=buster, r=dcone

This commit is contained in:
karnaze%netscape.com 2000-11-29 22:30:09 +00:00
Родитель 417a2a01ce
Коммит 667b9b772d
4 изменённых файлов: 26 добавлений и 0 удалений

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

@ -1739,6 +1739,11 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize = pass1MaxElementSize;
}
// if we are reflowed unconstrained, update our preferred width
if (!mPrevInFlow && (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth)) {
SetPreferredWidth(aDesiredSize.width);
}
// See if we are supposed to compute our maximum width
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
PRBool isAutoOrPctWidth = IsAutoLayout() &&

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

@ -1490,6 +1490,14 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
// Return our desired rect
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;
// See if we are supposed to compute our maximum width
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
// XXX this needs to consider the possibility of a caption being wider
// than the inner table, but this is the safest way to fix bug 55545
if (mInnerTableFrame) {
aDesiredSize.mMaximumWidth = ((nsTableFrame*)mInnerTableFrame)->GetPreferredWidth();
}
}
if (nsDebugTable::gRflTableOuter) nsTableFrame::DebugReflow("TO::Rfl ex", this, nsnull, &aDesiredSize, aStatus);
return rv;

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

@ -1739,6 +1739,11 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize = pass1MaxElementSize;
}
// if we are reflowed unconstrained, update our preferred width
if (!mPrevInFlow && (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth)) {
SetPreferredWidth(aDesiredSize.width);
}
// See if we are supposed to compute our maximum width
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
PRBool isAutoOrPctWidth = IsAutoLayout() &&

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

@ -1490,6 +1490,14 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
// Return our desired rect
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;
// See if we are supposed to compute our maximum width
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
// XXX this needs to consider the possibility of a caption being wider
// than the inner table, but this is the safest way to fix bug 55545
if (mInnerTableFrame) {
aDesiredSize.mMaximumWidth = ((nsTableFrame*)mInnerTableFrame)->GetPreferredWidth();
}
}
if (nsDebugTable::gRflTableOuter) nsTableFrame::DebugReflow("TO::Rfl ex", this, nsnull, &aDesiredSize, aStatus);
return rv;