bug 72396 - fix CalcBorderBoxWidth to not use unconstrained width. Fix column balancing to be skipped when there is an unconstrained width. sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@90348 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
d9ef6a1ec6
commit
222cdae092
@ -212,8 +212,9 @@ BasicTableLayoutStrategy::BalanceColumnWidths(nsIPresContext* aPresCont
|
||||
|
||||
// determine if the table is auto/fixed and get the fixed width if available
|
||||
nscoord maxWidth = mTableFrame->CalcBorderBoxWidth(aReflowState);
|
||||
if (NS_UNCONSTRAINEDSIZE == maxWidth) {
|
||||
NS_ASSERTION(PR_FALSE, "cannot balance with an unconstrained width");
|
||||
if (NS_UNCONSTRAINEDSIZE == maxWidth) {
|
||||
maxWidth = PR_MIN(maxWidth, aReflowState.availableWidth);
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != maxWidth, "cannot balance with an unconstrained width");
|
||||
return PR_FALSE;
|
||||
}
|
||||
// initialize the col percent and cell percent values to 0.
|
||||
|
||||
@ -3935,7 +3935,7 @@ nsTableFrame::CalcBorderBoxWidth(const nsHTMLReflowState& aState)
|
||||
|
||||
if (eStyleUnit_Auto == aState.mStylePosition->mWidth.GetUnit()) {
|
||||
if (0 == width) {
|
||||
width = NS_UNCONSTRAINEDSIZE;
|
||||
width = aState.availableWidth;
|
||||
}
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.availableWidth) {
|
||||
nsMargin margin(0,0,0,0);
|
||||
|
||||
@ -212,8 +212,9 @@ BasicTableLayoutStrategy::BalanceColumnWidths(nsIPresContext* aPresCont
|
||||
|
||||
// determine if the table is auto/fixed and get the fixed width if available
|
||||
nscoord maxWidth = mTableFrame->CalcBorderBoxWidth(aReflowState);
|
||||
if (NS_UNCONSTRAINEDSIZE == maxWidth) {
|
||||
NS_ASSERTION(PR_FALSE, "cannot balance with an unconstrained width");
|
||||
if (NS_UNCONSTRAINEDSIZE == maxWidth) {
|
||||
maxWidth = PR_MIN(maxWidth, aReflowState.availableWidth);
|
||||
NS_ASSERTION(NS_UNCONSTRAINEDSIZE != maxWidth, "cannot balance with an unconstrained width");
|
||||
return PR_FALSE;
|
||||
}
|
||||
// initialize the col percent and cell percent values to 0.
|
||||
|
||||
@ -3935,7 +3935,7 @@ nsTableFrame::CalcBorderBoxWidth(const nsHTMLReflowState& aState)
|
||||
|
||||
if (eStyleUnit_Auto == aState.mStylePosition->mWidth.GetUnit()) {
|
||||
if (0 == width) {
|
||||
width = NS_UNCONSTRAINEDSIZE;
|
||||
width = aState.availableWidth;
|
||||
}
|
||||
if (NS_UNCONSTRAINEDSIZE != aState.availableWidth) {
|
||||
nsMargin margin(0,0,0,0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user