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

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..4845ec9a454442c85dd298c705dbaa761a276494 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();
+ int 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;
+}
+
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)) {
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