зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
417a2a01ce
Коммит
667b9b772d
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче