fix handling of empty rowgroups (that are rg without a row beneath) in the border collapse code (bug 383193 r/sr=bzbarsky a=mtschrep

This commit is contained in:
bmlk@gmx.de 2007-12-15 12:23:10 -08:00
Родитель e6b2825825
Коммит b64d41431a
1 изменённых файлов: 10 добавлений и 17 удалений

Просмотреть файл

@ -3303,8 +3303,8 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState,
// case, it will be number of all rows. If the unstyled rows don't have a
// height, divide the space equally among them.
nscoord divisor = 0;
PRInt32 eligibleRows = 0;
PRBool expandEmptyRows = PR_FALSE;
PRInt32 eligibleRows = 0;
PRBool expandEmptyRows = PR_FALSE;
if (!firstUnStyledRow) {
// there is no unstyled row
@ -3327,10 +3327,10 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState,
}
}
}
if (divisor <= 0) {
if (eligibleRows > 0) {
expandEmptyRows = PR_TRUE;
}
if (divisor <= 0) {
if (eligibleRows > 0) {
expandEmptyRows = PR_TRUE;
}
else {
NS_ERROR("invalid divisor");
return;
@ -4221,21 +4221,15 @@ BCMapCellIterator::SetNewRow(nsTableRowFrame* aRow)
PRBool
BCMapCellIterator::SetNewRowGroup(PRBool aFindFirstDamagedRow)
{
mAtEnd = PR_TRUE;
mRowGroupIndex++;
mAtEnd = PR_TRUE;
PRInt32 numRowGroups = mRowGroups.Length();
mCellMap = nsnull;
for (PRInt32 rgX = mRowGroupIndex; rgX < numRowGroups; rgX++) {
// XXXbz do we really want the group at mRowGroupIndex? If so, what's the
// point of this rgX loop variable, exactly? Why not just do a while
// (mRowGroupIndex < numRowGroups) loop or something? I suspect this means
// to be getting the rowgroup at rgX.
for (mRowGroupIndex++; mRowGroupIndex < numRowGroups; mRowGroupIndex++) {
mRowGroup = mRowGroups[mRowGroupIndex];
PRInt32 rowCount = mRowGroup->GetRowCount();
mRowGroupStart = mRowGroup->GetStartRowIndex();
mRowGroupEnd = mRowGroupStart + rowCount - 1;
if (rowCount > 0) { // XXXbz and if it's not we just keep looping? What's
// the point?
if (rowCount > 0) {
mCellMap = mTableCellMap->GetMapFor(mRowGroup, mCellMap);
if (!mCellMap) ABORT1(PR_FALSE);
nsTableRowFrame* firstRow = mRowGroup->GetFirstRow();
@ -4251,8 +4245,7 @@ BCMapCellIterator::SetNewRowGroup(PRBool aFindFirstDamagedRow)
}
}
}
else {
mRowGroupIndex++;
else {
continue;
}
}