diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index 59236994bfd..94229dd2786 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -2035,26 +2035,19 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( const nsHTMLReflowSt } // second, fix up tables where column width attributes give us a table that is too wide or too narrow - // IFF the table is NOT (auto-width && all columns have fixed width) - PRInt32 numFixedColumns=0; - PRInt32 *fixedColumns=nsnull; - mTableFrame->GetColumnsByType(eStyleUnit_Coord, numFixedColumns, fixedColumns); - if (!((PR_TRUE==aTableIsAutoWidth) && (numFixedColumns==mNumCols))) - { - nscoord computedWidth=0; - for (PRInt32 i=0; iGetColumnWidth(i) + colInset; - } - if (computedWidthaMaxWidth) - { // then shrink the table width because its too wide - AdjustTableThatIsTooWide(computedWidth, aMaxWidth, PR_FALSE); - } + nscoord computedWidth=0; + for (PRInt32 i=0; iGetColumnWidth(i) + colInset; + } + if (computedWidthaMaxWidth) + { // then shrink the table width because its too wide + AdjustTableThatIsTooWide(computedWidth, aMaxWidth, PR_FALSE); } diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 3e654786f56..c34b264b559 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -3602,28 +3602,6 @@ PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, nsStylePosi return result; } -static PRBool -IsPseudoFrame(nsIFrame* aFrame) -{ - nsIContent* content; - nsIFrame* parentFrame; - PRBool result = PR_FALSE; - - aFrame->GetContent(content); - aFrame->GetGeometricParent(parentFrame); - if (nsnull != parentFrame) { - nsIContent* parentContent; - - parentFrame->GetContent(parentContent); - if (parentContent == content) { - result = PR_TRUE; - } - NS_RELEASE(parentContent); - } - - NS_RELEASE(content); - return result; -} /* helper method for getting the width of the table's containing block */ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowState) @@ -3645,22 +3623,18 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta if (NS_OK==rv) { // we found a block, see if it's really a table cell (which means we're a nested table) PRBool skipThisBlock=PR_FALSE; - // XXX FIX ME... - if (IsPseudoFrame(block)) + const nsReflowState* parentRS = rs->parentReflowState; + if (nsnull!=parentRS) { - const nsReflowState* parentRS = rs->parentReflowState; + parentRS = parentRS->parentReflowState; if (nsnull!=parentRS) { - parentRS = parentRS->parentReflowState; - if (nsnull!=parentRS) - { - nsIFrame* cell = nsnull; - rv = parentRS->frame->QueryInterface(kTableCellFrameCID, (void**) &cell); - if (rv == NS_OK) { - if (PR_TRUE==gsDebugNT) - printf("%p: found a block pframe %p in a cell, skipping it.\n", aReflowState.frame, block); - skipThisBlock = PR_TRUE; - } + nsIFrame* cell = nsnull; + rv = parentRS->frame->QueryInterface(kTableCellFrameCID, (void**) &cell); + if (rv == NS_OK) { + if (PR_TRUE==gsDebugNT) + printf("%p: found a block pframe %p in a cell, skipping it.\n", aReflowState.frame, block); + skipThisBlock = PR_TRUE; } } } diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index 59236994bfd..94229dd2786 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -2035,26 +2035,19 @@ PRBool BasicTableLayoutStrategy::BalanceColumnsConstrained( const nsHTMLReflowSt } // second, fix up tables where column width attributes give us a table that is too wide or too narrow - // IFF the table is NOT (auto-width && all columns have fixed width) - PRInt32 numFixedColumns=0; - PRInt32 *fixedColumns=nsnull; - mTableFrame->GetColumnsByType(eStyleUnit_Coord, numFixedColumns, fixedColumns); - if (!((PR_TRUE==aTableIsAutoWidth) && (numFixedColumns==mNumCols))) - { - nscoord computedWidth=0; - for (PRInt32 i=0; iGetColumnWidth(i) + colInset; - } - if (computedWidthaMaxWidth) - { // then shrink the table width because its too wide - AdjustTableThatIsTooWide(computedWidth, aMaxWidth, PR_FALSE); - } + nscoord computedWidth=0; + for (PRInt32 i=0; iGetColumnWidth(i) + colInset; + } + if (computedWidthaMaxWidth) + { // then shrink the table width because its too wide + AdjustTableThatIsTooWide(computedWidth, aMaxWidth, PR_FALSE); } diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 3e654786f56..c34b264b559 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -3602,28 +3602,6 @@ PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, nsStylePosi return result; } -static PRBool -IsPseudoFrame(nsIFrame* aFrame) -{ - nsIContent* content; - nsIFrame* parentFrame; - PRBool result = PR_FALSE; - - aFrame->GetContent(content); - aFrame->GetGeometricParent(parentFrame); - if (nsnull != parentFrame) { - nsIContent* parentContent; - - parentFrame->GetContent(parentContent); - if (parentContent == content) { - result = PR_TRUE; - } - NS_RELEASE(parentContent); - } - - NS_RELEASE(content); - return result; -} /* helper method for getting the width of the table's containing block */ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowState) @@ -3645,22 +3623,18 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta if (NS_OK==rv) { // we found a block, see if it's really a table cell (which means we're a nested table) PRBool skipThisBlock=PR_FALSE; - // XXX FIX ME... - if (IsPseudoFrame(block)) + const nsReflowState* parentRS = rs->parentReflowState; + if (nsnull!=parentRS) { - const nsReflowState* parentRS = rs->parentReflowState; + parentRS = parentRS->parentReflowState; if (nsnull!=parentRS) { - parentRS = parentRS->parentReflowState; - if (nsnull!=parentRS) - { - nsIFrame* cell = nsnull; - rv = parentRS->frame->QueryInterface(kTableCellFrameCID, (void**) &cell); - if (rv == NS_OK) { - if (PR_TRUE==gsDebugNT) - printf("%p: found a block pframe %p in a cell, skipping it.\n", aReflowState.frame, block); - skipThisBlock = PR_TRUE; - } + nsIFrame* cell = nsnull; + rv = parentRS->frame->QueryInterface(kTableCellFrameCID, (void**) &cell); + if (rv == NS_OK) { + if (PR_TRUE==gsDebugNT) + printf("%p: found a block pframe %p in a cell, skipping it.\n", aReflowState.frame, block); + skipThisBlock = PR_TRUE; } } }