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

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

Issue 2534413004: Made varied number of cells in each row based on row's requirement. (Closed)
Patch Set: Reset TestExpectations file Created 3 years, 11 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
Index: third_party/WebKit/Source/core/layout/LayoutTableSection.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.h b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
index 916aab9e2f2aa2e4802a97339ac1decc9460a440..52e5d5dc844c3b0fa61fe1717e71fe800053be86 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.h
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
@@ -218,6 +218,8 @@ class CORE_EXPORT LayoutTableSection final : public LayoutTableBoxComponent {
return m_grid[row].row[effectiveColumn];
}
LayoutTableCell* primaryCellAt(unsigned row, unsigned effectiveColumn) {
+ if (effectiveColumn >= numCols(row))
+ return nullptr;
CellStruct& c = m_grid[row].row[effectiveColumn];
return c.primaryCell();
}
@@ -227,6 +229,8 @@ class CORE_EXPORT LayoutTableSection final : public LayoutTableBoxComponent {
row, effectiveColumn);
}
+ unsigned numCols(unsigned row) const { return m_grid[row].row.size(); }
+
// Returns null for cells with a rowspan that exceed the last row. Possibly
// others.
LayoutTableRow* rowLayoutObjectAt(unsigned row) {
@@ -345,7 +349,15 @@ class CORE_EXPORT LayoutTableSection final : public LayoutTableBoxComponent {
return m_grid[row].rowLayoutObject ? table()->vBorderSpacing() : 0;
}
- void ensureRows(unsigned);
+ void ensureRows(unsigned numRows) {
+ if (numRows > m_grid.size())
+ m_grid.grow(numRows);
+ }
+
+ void ensureCols(unsigned rowIndex, unsigned numCols) {
+ if (numCols > this->numCols(rowIndex))
+ m_grid[rowIndex].row.grow(numCols);
+ }
bool rowHasOnlySpanningCells(unsigned);
unsigned calcRowHeightHavingOnlySpanningCells(unsigned,
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698