Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1842)

Unified Diff: Source/core/rendering/RenderTableSection.cpp

Issue 23503083: Table conent is rendered over the border when colspan present with rowspan. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698