diff --git a/layout/html/table/src/nsCellMap.cpp b/layout/html/table/src/nsCellMap.cpp
index 9d4e166652d..a12656f2c3b 100644
--- a/layout/html/table/src/nsCellMap.cpp
+++ b/layout/html/table/src/nsCellMap.cpp
@@ -2421,9 +2421,9 @@ PRBool nsCellMap::ColHasSpanningCells(nsTableCellMap& aMap,
for (PRInt32 rowIndex = 0; rowIndex < mRowCount; rowIndex++) {
CellData* cd = GetDataAt(aMap, rowIndex, aColIndex, PR_TRUE);
if (cd && (cd->IsOrig())) { // cell originates
- CellData* cd2 = GetDataAt(aMap, rowIndex + 1, aColIndex, PR_TRUE);
+ CellData* cd2 = GetDataAt(aMap, rowIndex, aColIndex +1, PR_TRUE);
if (cd2 && cd2->IsColSpan()) { // cd2 is spanned by a col
- if (cd->GetCellFrame() == GetCellFrame(rowIndex + 1, aColIndex, *cd2, PR_FALSE)) {
+ if (cd->GetCellFrame() == GetCellFrame(rowIndex , aColIndex + 1, *cd2, PR_FALSE)) {
return PR_TRUE;
}
}
diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp
index 63567313d18..6374b4469d6 100644
--- a/layout/html/table/src/nsTableFrame.cpp
+++ b/layout/html/table/src/nsTableFrame.cpp
@@ -3782,7 +3782,7 @@ nsTableFrame::CellChangedWidth(const nsTableCellFrame& aCellFrame,
PRBool colMinGetsSmaller = (cellMin < colMin) && (colMin == aPrevCellMin);
if (colMinGetsBigger || colMinGetsSmaller) {
- if (ColIsSpannedInto(colIndex)) {
+ if (ColIsSpannedInto(colIndex) || ColHasSpanningCells(colIndex)) {
// bail out if a colspan is involved
SetNeedStrategyInit(PR_TRUE);
return PR_TRUE;
@@ -7324,13 +7324,24 @@ PRBool nsTableFrame::RowIsSpannedInto(PRInt32 aRowIndex)
return result;
}
+PRBool nsTableFrame::ColHasSpanningCells(PRInt32 aColIndex)
+{
+ PRBool result = PR_FALSE;
+ nsTableCellMap * cellMap = GetCellMap();
+ NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
+ if (cellMap) {
+ result = cellMap->ColHasSpanningCells(aColIndex);
+ }
+ return result;
+}
+
PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
{
PRBool result = PR_FALSE;
nsTableCellMap * cellMap = GetCellMap();
NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
if (cellMap) {
- result = cellMap->ColIsSpannedInto(aColIndex);
+ result = cellMap->ColIsSpannedInto(aColIndex);
}
return result;
}
diff --git a/layout/tables/nsCellMap.cpp b/layout/tables/nsCellMap.cpp
index 9d4e166652d..a12656f2c3b 100644
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -2421,9 +2421,9 @@ PRBool nsCellMap::ColHasSpanningCells(nsTableCellMap& aMap,
for (PRInt32 rowIndex = 0; rowIndex < mRowCount; rowIndex++) {
CellData* cd = GetDataAt(aMap, rowIndex, aColIndex, PR_TRUE);
if (cd && (cd->IsOrig())) { // cell originates
- CellData* cd2 = GetDataAt(aMap, rowIndex + 1, aColIndex, PR_TRUE);
+ CellData* cd2 = GetDataAt(aMap, rowIndex, aColIndex +1, PR_TRUE);
if (cd2 && cd2->IsColSpan()) { // cd2 is spanned by a col
- if (cd->GetCellFrame() == GetCellFrame(rowIndex + 1, aColIndex, *cd2, PR_FALSE)) {
+ if (cd->GetCellFrame() == GetCellFrame(rowIndex , aColIndex + 1, *cd2, PR_FALSE)) {
return PR_TRUE;
}
}
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
index 63567313d18..6374b4469d6 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -3782,7 +3782,7 @@ nsTableFrame::CellChangedWidth(const nsTableCellFrame& aCellFrame,
PRBool colMinGetsSmaller = (cellMin < colMin) && (colMin == aPrevCellMin);
if (colMinGetsBigger || colMinGetsSmaller) {
- if (ColIsSpannedInto(colIndex)) {
+ if (ColIsSpannedInto(colIndex) || ColHasSpanningCells(colIndex)) {
// bail out if a colspan is involved
SetNeedStrategyInit(PR_TRUE);
return PR_TRUE;
@@ -7324,13 +7324,24 @@ PRBool nsTableFrame::RowIsSpannedInto(PRInt32 aRowIndex)
return result;
}
+PRBool nsTableFrame::ColHasSpanningCells(PRInt32 aColIndex)
+{
+ PRBool result = PR_FALSE;
+ nsTableCellMap * cellMap = GetCellMap();
+ NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
+ if (cellMap) {
+ result = cellMap->ColHasSpanningCells(aColIndex);
+ }
+ return result;
+}
+
PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
{
PRBool result = PR_FALSE;
nsTableCellMap * cellMap = GetCellMap();
NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
if (cellMap) {
- result = cellMap->ColIsSpannedInto(aColIndex);
+ result = cellMap->ColIsSpannedInto(aColIndex);
}
return result;
}