From 347661a45d01cb3238e396bc7d5a7c14b060efed Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Tue, 12 Sep 2000 14:24:35 +0000 Subject: [PATCH] bug 51727 - rebalance table cols when fixed cell gets smaller and was the contributor of the previous col width. r=rods. git-svn-id: svn://10.0.0.236/trunk@78873 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/BasicTableLayoutStrategy.cpp | 8 ++++++-- mozilla/layout/tables/BasicTableLayoutStrategy.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index 235e814a8d2..5694adf0217 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -1793,12 +1793,16 @@ PRBool BasicTableLayoutStrategy::ColumnsAreValidFor(const nsTableCellFrame& aCel return PR_FALSE; // XXX add cases where table has coord width } } - if ((colFrame->GetWidth(FIX_ADJ) > 0) && (colFrame->GetWidth(FIX) <= 0)) { + nscoord colFix = colFrame->GetWidth(FIX); + if ((colFrame->GetWidth(FIX_ADJ) > 0) && (colFix <= 0)) { if (desChanged) { return PR_FALSE; // its unfortunate that the balancing algorithms cause this - // XXX add cases where table has coord width + // XXX add cases where table has coord width } } + if ((colFix > 0) && (desChanged) && (cellDes < aPrevCellDes) && (aPrevCellDes == colFix)) { + return PR_FALSE; + } } else { // the column width is not constrained if (desChanged) { diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index 235e814a8d2..5694adf0217 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -1793,12 +1793,16 @@ PRBool BasicTableLayoutStrategy::ColumnsAreValidFor(const nsTableCellFrame& aCel return PR_FALSE; // XXX add cases where table has coord width } } - if ((colFrame->GetWidth(FIX_ADJ) > 0) && (colFrame->GetWidth(FIX) <= 0)) { + nscoord colFix = colFrame->GetWidth(FIX); + if ((colFrame->GetWidth(FIX_ADJ) > 0) && (colFix <= 0)) { if (desChanged) { return PR_FALSE; // its unfortunate that the balancing algorithms cause this - // XXX add cases where table has coord width + // XXX add cases where table has coord width } } + if ((colFix > 0) && (desChanged) && (cellDes < aPrevCellDes) && (aPrevCellDes == colFix)) { + return PR_FALSE; + } } else { // the column width is not constrained if (desChanged) {