Index: Source/core/rendering/RenderTableSection.cpp |
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp |
index 268c00b7c27ca03e05436c4c50343dae7941594d..dec768e728648bea63667a171d6d707a19a39a7b 100644 |
--- a/Source/core/rendering/RenderTableSection.cpp |
+++ b/Source/core/rendering/RenderTableSection.cpp |
@@ -420,6 +420,36 @@ static bool compareRowSpanCellsInHeightDistributionOrder(const RenderTableCell* |
return false; |
} |
+bool RenderTableSection::isHeightNeededForRowHavingOnlySpanningCells(unsigned row) |
+{ |
+ unsigned totalCols = m_grid[row].row.size(); |
+ |
+ if (!totalCols) |
+ return false; |
+ |
+ for (unsigned col = 0; col < totalCols; col++) { |
+ const CellStruct& rowSpanCell = cellAt(row, col); |
+ |
+ if (rowSpanCell.cells.size()) { |
+ RenderTableCell* cell = rowSpanCell.cells[0]; |
+ const unsigned rowIndex = cell->rowIndex(); |
+ const unsigned rowSpan = cell->rowSpan(); |
+ unsigned totalRowSpanCellHeight = 0; |
+ |
+ for (unsigned row = 0; row < rowSpan; row++) { |
+ unsigned actualRow = row + rowIndex; |
+ totalRowSpanCellHeight += m_rowPos[actualRow + 1] - m_rowPos[actualRow]; |
+ } |
+ totalRowSpanCellHeight -= borderSpacingForRow(rowIndex + rowSpan - 1); |
+ |
+ if (totalRowSpanCellHeight < cell->logicalHeightForRowSizing()) |
+ return true; |
+ } |
+ } |
+ |
+ return false; |
+} |
Julien - ping for review
2013/09/20 18:34:53
This really looks like it should be folded into ro
|
+ |
unsigned RenderTableSection::calcRowHeightHavingOnlySpanningCells(unsigned row) |
{ |
ASSERT(rowHasOnlySpanningCells(row)); |
@@ -452,7 +482,7 @@ void RenderTableSection::updateRowsHeightHavingOnlySpanningCells(RenderTableCell |
for (unsigned row = 0; row < spanningRowsHeight.rowHeight.size(); row++) { |
unsigned actualRow = row + rowIndex; |
- if (!spanningRowsHeight.rowHeight[row] && rowHasOnlySpanningCells(actualRow)) { |
+ if (!spanningRowsHeight.rowHeight[row] && rowHasOnlySpanningCells(actualRow) && isHeightNeededForRowHavingOnlySpanningCells(actualRow)) { |
Julien - ping for review
2013/09/20 18:34:53
Is the !spanningRowsHeight.rowHeight[row] still ne
suchit.agrawal
2013/09/20 22:12:00
Yes !spanningRowsHeight.rowHeight[row] is needed b
|
spanningRowsHeight.rowHeight[row] = calcRowHeightHavingOnlySpanningCells(actualRow); |
accumulatedPositionIncrease += spanningRowsHeight.rowHeight[row]; |
} |