зеркало из https://github.com/mozilla/pjs.git
bug 106158 - changed outer table fix up of nested inner table's computed width to consider if the min width fits.
removed tree specific code. sr=waterson, r=alexsavulov.
This commit is contained in:
Родитель
1d508f46fc
Коммит
70c38ff928
|
@ -942,8 +942,8 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
|
|||
nsSize(availWidth, aOuterRS.availableHeight));
|
||||
childRS.reason = aReflowReason;
|
||||
|
||||
// If mComputedWidth > availableWidth for a nested percent table then adjust it
|
||||
// based on availableWidth if this isn't the intial reflow.
|
||||
// If mComputedWidth > availWidth and availWidth >= minWidth for a nested percent table
|
||||
// then adjust mComputedWidth based on availableWidth if this isn't the intial reflow
|
||||
if ((childRS.mComputedWidth > childRS.availableWidth) &&
|
||||
(NS_UNCONSTRAINEDSIZE != childRS.mComputedWidth) &&
|
||||
(eReflowReason_Initial != aReflowReason) &&
|
||||
|
@ -951,35 +951,12 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
|
|||
PRBool isPctWidth;
|
||||
IsAutoWidth(*aChildFrame, &isPctWidth);
|
||||
if (isPctWidth) {
|
||||
childRS.mComputedWidth = childRS.availableWidth - childRS.mComputedBorderPadding.left -
|
||||
childRS.mComputedBorderPadding.right;
|
||||
}
|
||||
}
|
||||
|
||||
// Normally, the outer table's mComputed values are NS_INTRINSICSIZE (although to
|
||||
// to work around boxes they can also be set to 0) since they depend on the caption
|
||||
// and inner table. Boxes can force a constrained size.
|
||||
// XXX remove this code when trees are converted to use grids instead of tables
|
||||
if ((aOuterRS.mComputedWidth != NS_INTRINSICSIZE) &&
|
||||
(aOuterRS.mComputedWidth != 0)) {
|
||||
if (mInnerTableFrame == aChildFrame) {
|
||||
childRS.mComputedWidth = aOuterRS.mComputedWidth - aMargin.left - childRS.mComputedBorderPadding.left -
|
||||
childRS.mComputedBorderPadding.right - aMargin.right;
|
||||
childRS.mComputedWidth = PR_MAX(0, childRS.mComputedWidth);
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(PR_FALSE, "box set mComputedWidth on an outer table with a caption");
|
||||
}
|
||||
}
|
||||
if ((aOuterRS.mComputedHeight != NS_INTRINSICSIZE) &&
|
||||
(aOuterRS.mComputedHeight != 0)) {
|
||||
if (mInnerTableFrame == aChildFrame) {
|
||||
childRS.mComputedHeight = aOuterRS.mComputedHeight - aMargin.top - childRS.mComputedBorderPadding.top -
|
||||
childRS.mComputedBorderPadding.bottom - aMargin.bottom;
|
||||
childRS.mComputedHeight = PR_MAX(0, childRS.mComputedHeight);
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(PR_FALSE, "box set mComputedHeight on an outer table with a caption");
|
||||
if ( ((aChildFrame == mInnerTableFrame) &&
|
||||
((nsTableFrame*)aChildFrame)->GetMinWidth() <= childRS.availableWidth) ||
|
||||
(aChildFrame != mInnerTableFrame)) {
|
||||
childRS.mComputedWidth = childRS.availableWidth - childRS.mComputedBorderPadding.left -
|
||||
childRS.mComputedBorderPadding.right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -942,8 +942,8 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
|
|||
nsSize(availWidth, aOuterRS.availableHeight));
|
||||
childRS.reason = aReflowReason;
|
||||
|
||||
// If mComputedWidth > availableWidth for a nested percent table then adjust it
|
||||
// based on availableWidth if this isn't the intial reflow.
|
||||
// If mComputedWidth > availWidth and availWidth >= minWidth for a nested percent table
|
||||
// then adjust mComputedWidth based on availableWidth if this isn't the intial reflow
|
||||
if ((childRS.mComputedWidth > childRS.availableWidth) &&
|
||||
(NS_UNCONSTRAINEDSIZE != childRS.mComputedWidth) &&
|
||||
(eReflowReason_Initial != aReflowReason) &&
|
||||
|
@ -951,35 +951,12 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
|
|||
PRBool isPctWidth;
|
||||
IsAutoWidth(*aChildFrame, &isPctWidth);
|
||||
if (isPctWidth) {
|
||||
childRS.mComputedWidth = childRS.availableWidth - childRS.mComputedBorderPadding.left -
|
||||
childRS.mComputedBorderPadding.right;
|
||||
}
|
||||
}
|
||||
|
||||
// Normally, the outer table's mComputed values are NS_INTRINSICSIZE (although to
|
||||
// to work around boxes they can also be set to 0) since they depend on the caption
|
||||
// and inner table. Boxes can force a constrained size.
|
||||
// XXX remove this code when trees are converted to use grids instead of tables
|
||||
if ((aOuterRS.mComputedWidth != NS_INTRINSICSIZE) &&
|
||||
(aOuterRS.mComputedWidth != 0)) {
|
||||
if (mInnerTableFrame == aChildFrame) {
|
||||
childRS.mComputedWidth = aOuterRS.mComputedWidth - aMargin.left - childRS.mComputedBorderPadding.left -
|
||||
childRS.mComputedBorderPadding.right - aMargin.right;
|
||||
childRS.mComputedWidth = PR_MAX(0, childRS.mComputedWidth);
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(PR_FALSE, "box set mComputedWidth on an outer table with a caption");
|
||||
}
|
||||
}
|
||||
if ((aOuterRS.mComputedHeight != NS_INTRINSICSIZE) &&
|
||||
(aOuterRS.mComputedHeight != 0)) {
|
||||
if (mInnerTableFrame == aChildFrame) {
|
||||
childRS.mComputedHeight = aOuterRS.mComputedHeight - aMargin.top - childRS.mComputedBorderPadding.top -
|
||||
childRS.mComputedBorderPadding.bottom - aMargin.bottom;
|
||||
childRS.mComputedHeight = PR_MAX(0, childRS.mComputedHeight);
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(PR_FALSE, "box set mComputedHeight on an outer table with a caption");
|
||||
if ( ((aChildFrame == mInnerTableFrame) &&
|
||||
((nsTableFrame*)aChildFrame)->GetMinWidth() <= childRS.availableWidth) ||
|
||||
(aChildFrame != mInnerTableFrame)) {
|
||||
childRS.mComputedWidth = childRS.availableWidth - childRS.mComputedBorderPadding.left -
|
||||
childRS.mComputedBorderPadding.right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче