Bug 1405929 - Part 2 : fix the wrong row index. r?dbaron
MozReview-Commit-ID: 2jKNvw4kwpZ
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -896,24 +896,26 @@ bool nsTableCellMap::RowHasSpanningCells
cellMap = cellMap->GetNextSibling();
}
return false;
}
void
nsTableCellMap::ResetBStartStart(LogicalSide aSide,
nsCellMap& aCellMap,
+ uint32_t aRowGroupStart,
uint32_t aRowIndex,
uint32_t aColIndex,
bool aIsBEndIEnd)
{
if (!mBCInfo || aIsBEndIEnd) ABORT0();
BCCellData* cellData;
BCData* bcData = nullptr;
+ aRowIndex = aRowIndex - aRowGroupStart;
switch(aSide) {
case eLogicalSideBEnd:
aRowIndex++;
MOZ_FALLTHROUGH;
case eLogicalSideBStart:
cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex, aColIndex);
if (cellData) {
--- a/layout/tables/nsCellMap.h
+++ b/layout/tables/nsCellMap.h
@@ -186,16 +186,17 @@ protected:
int32_t aStartRowIndex,
nsTArray<nsTableRowFrame*>* aRowsToInsert,
int32_t aNumRowsToRemove,
TableArea& aDamageArea);
public:
void ResetBStartStart(mozilla::LogicalSide aSide,
nsCellMap& aCellMap,
+ uint32_t aRowGroupStart,
uint32_t aYPos,
uint32_t aXPos,
bool aIsBEndIEnd = false);
void SetBCBorderEdge(mozilla::LogicalSide aEdge,
nsCellMap& aCellMap,
uint32_t aCellMapStart,
uint32_t aYPos,
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -6468,16 +6468,17 @@ nsTableFrame::CalcBCBorders()
BCCellBorder& nextBorder = lastBEndBorders[info.mColIndex + 1];
if ((thisBorder.color == nextBorder.color) &&
(thisBorder.width == nextBorder.width) &&
(thisBorder.style == nextBorder.style)) {
// set the flag on the next border indicating it is not the start of a
// new segment
if (iter.mCellMap) {
tableCellMap->ResetBStartStart(eLogicalSideBEnd, *iter.mCellMap,
+ iter.mRowGroupStart,
info.GetCellEndRowIndex(),
info.GetCellEndColIndex() + 1);
}
}
}
}
} // for (iter.First(info); info.mCell; iter.Next(info)) {
// reset the bc flag and damage area