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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp

Issue 2434033003: Clean up LayoutTableSection::calcRowLogicalHeight() a bit. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index 7586ee7266b54949e7ef25b59c22ed8cee6c79cc..61f33769c55f792adddb98c2dc08ed1953609c68 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -852,9 +852,6 @@ int LayoutTableSection::calcRowLogicalHeight() {
m_rowPos[0] = 0;
SpanningLayoutTableCells rowSpanCells;
-#if ENABLE(ASSERT)
- HashSet<const LayoutTableCell*> uniqueCells;
-#endif
for (unsigned r = 0; r < m_grid.size(); r++) {
m_grid[r].baseline = -1;
@@ -879,30 +876,25 @@ int LayoutTableSection::calcRowLogicalHeight() {
Row& row = m_grid[r].row;
unsigned totalCols = row.size();
- LayoutTableCell* lastRowSpanCell = nullptr;
for (unsigned c = 0; c < totalCols; c++) {
CellStruct& current = cellAt(r, c);
+ if (current.inColSpan)
+ continue;
for (unsigned i = 0; i < current.cells.size(); i++) {
cell = current.cells[i];
- if (current.inColSpan && cell->rowSpan() == 1)
+
+ // For row spanning cells, we only handle them for the first row they
+ // span. This ensures we take their baseline into account.
+ if (cell->rowIndex() != r)
continue;
if (cell->rowSpan() > 1) {
- // For row spanning cells, we only handle them for the first row they
- // span. This ensures we take their baseline into account.
- if (lastRowSpanCell != cell && cell->rowIndex() == r) {
-#if ENABLE(ASSERT)
- ASSERT(!uniqueCells.contains(cell));
- uniqueCells.add(cell);
-#endif
-
- rowSpanCells.append(cell);
- lastRowSpanCell = cell;
- }
+ DCHECK(!rowSpanCells.contains(cell));
+ rowSpanCells.append(cell);
}
- if (cell->rowIndex() == r && cell->hasOverrideLogicalContentHeight()) {
+ if (cell->hasOverrideLogicalContentHeight()) {
cell->clearIntrinsicPadding();
cell->clearOverrideSize();
cell->forceChildLayout();
@@ -914,8 +906,7 @@ int LayoutTableSection::calcRowLogicalHeight() {
// Find out the baseline. The baseline is set on the first row in a
// rowSpan.
- if (cell->rowIndex() == r)
- updateBaselineForCell(cell, r, baselineDescent);
+ updateBaselineForCell(cell, r, baselineDescent);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698