From 0e5df88ea8eb28fa542e656f3b4aad2b2e7cbcac Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Thu, 20 Aug 1998 17:31:20 +0000 Subject: [PATCH] verify that proportionate-width columns (1* format, or COLS attribute) get sized to at least their minimum width git-svn-id: svn://10.0.0.236/trunk@8255 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/table/src/BasicTableLayoutStrategy.cpp | 12 ++++++++++++ mozilla/layout/tables/BasicTableLayoutStrategy.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index a55729a544e..3ebcdc42071 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -1430,7 +1430,13 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(const nsReflowState& aR { // for every proportionally-sized column, set the col width to the computed width ProportionalColumnLayoutStruct * info = (ProportionalColumnLayoutStruct *)(proportionalColumnsList->ElementAt(i)); + // verify that the computed width is at least the minimum width nscoord computedColWidth = info->mProportion*widthPerSlice; + // compute the requested proportional width + nsTableColFrame *colFrame; + mTableFrame->GetColumnFrame(info->mColIndex, colFrame); + nscoord minColWidth = colFrame->GetMinColWidth(); + computedColWidth = PR_MAX(computedColWidth, minColWidth); mTableFrame->SetColumnWidth(info->mColIndex, computedColWidth); if (gsDebug==PR_TRUE) printf (" 3 proportional step 2: col %d given %d proportion of remaining space %d, set to width = %d\n", @@ -2010,7 +2016,13 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( const nsReflowState& } else { + // compute the requested proportional width nscoord computedColWidth = info->mProportion*widthPerSlice; + // verify that the computed width is at least the minimum width + nsTableColFrame *colFrame; + mTableFrame->GetColumnFrame(info->mColIndex, colFrame); + nscoord minColWidth = colFrame->GetMinColWidth(); + computedColWidth = PR_MAX(computedColWidth, minColWidth); mTableFrame->SetColumnWidth(info->mColIndex, computedColWidth); if (gsDebug==PR_TRUE) printf (" 4 proportion: col %d given %d proportion of remaining space %d, set to width = %d\n", diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index a55729a544e..3ebcdc42071 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -1430,7 +1430,13 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsTableFits(const nsReflowState& aR { // for every proportionally-sized column, set the col width to the computed width ProportionalColumnLayoutStruct * info = (ProportionalColumnLayoutStruct *)(proportionalColumnsList->ElementAt(i)); + // verify that the computed width is at least the minimum width nscoord computedColWidth = info->mProportion*widthPerSlice; + // compute the requested proportional width + nsTableColFrame *colFrame; + mTableFrame->GetColumnFrame(info->mColIndex, colFrame); + nscoord minColWidth = colFrame->GetMinColWidth(); + computedColWidth = PR_MAX(computedColWidth, minColWidth); mTableFrame->SetColumnWidth(info->mColIndex, computedColWidth); if (gsDebug==PR_TRUE) printf (" 3 proportional step 2: col %d given %d proportion of remaining space %d, set to width = %d\n", @@ -2010,7 +2016,13 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( const nsReflowState& } else { + // compute the requested proportional width nscoord computedColWidth = info->mProportion*widthPerSlice; + // verify that the computed width is at least the minimum width + nsTableColFrame *colFrame; + mTableFrame->GetColumnFrame(info->mColIndex, colFrame); + nscoord minColWidth = colFrame->GetMinColWidth(); + computedColWidth = PR_MAX(computedColWidth, minColWidth); mTableFrame->SetColumnWidth(info->mColIndex, computedColWidth); if (gsDebug==PR_TRUE) printf (" 4 proportion: col %d given %d proportion of remaining space %d, set to width = %d\n",