diff --git a/layout/tables/BasicTableLayoutStrategy.cpp b/layout/tables/BasicTableLayoutStrategy.cpp index a2c2ee2e9ade..2beb3e493cca 100644 --- a/layout/tables/BasicTableLayoutStrategy.cpp +++ b/layout/tables/BasicTableLayoutStrategy.cpp @@ -704,6 +704,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth, PRInt32 numNonSpecZeroWidthCols = 0; PRInt32 col; + nsTableCellMap *cellMap = mTableFrame->GetCellMap(); for (col = aFirstCol; col < aFirstCol + aColCount; ++col) { nsTableColFrame *colFrame = mTableFrame->GetColFrame(col); if (!colFrame) { @@ -737,7 +738,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth, pref_width); } else if (pref_width == 0) { if (aWidthType == BTLS_FINAL_WIDTH && - mTableFrame->ColumnHasCellSpacingBefore(col)) { + cellMap->GetNumCellsOriginatingInCol(col) > 0) { ++numNonSpecZeroWidthCols; } } else { @@ -935,7 +936,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth, "when we're setting final width."); if (pct == 0.0f && !colFrame->GetHasSpecifiedCoord() && - mTableFrame->ColumnHasCellSpacingBefore(col)) { + cellMap->GetNumCellsOriginatingInCol(col) > 0) { NS_ASSERTION(col_width == 0 && colFrame->GetPrefCoord() == 0, diff --git a/layout/tables/crashtests/413091.xhtml b/layout/tables/crashtests/413091.xhtml new file mode 100644 index 000000000000..d9f6732fbc60 --- /dev/null +++ b/layout/tables/crashtests/413091.xhtml @@ -0,0 +1,7 @@ + + + + +
+ + diff --git a/layout/tables/crashtests/crashtests.list b/layout/tables/crashtests/crashtests.list index c785d67730c0..8aa7d009e7dd 100644 --- a/layout/tables/crashtests/crashtests.list +++ b/layout/tables/crashtests/crashtests.list @@ -71,6 +71,7 @@ load 403579-1.html load 404301-1.xhtml load 408753-1.xhtml load 411582.xhtml +load 413091.xhtml load 413180-1.html load 416845-1.xhtml load 416845-2.xhtml diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index d473acccf065..93183c66b96d 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -4054,6 +4054,9 @@ nsTableFrame::ColumnHasCellSpacingBefore(PRInt32 aColIndex) const // as they load, we assume that all columns are significant. if (LayoutStrategy()->GetType() == nsITableLayoutStrategy::Fixed) return PR_TRUE; + // the first column is always significant + if (aColIndex == 0) + return PR_TRUE; nsTableCellMap* cellMap = GetCellMap(); if (!cellMap) return PR_FALSE;