Chromium Code Reviews| 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..ac73b8e7708af6b3c3ce968043856f3897811a89 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 > LayoutTableSection::numCols(rowIndex)) |
|
mstensho (USE GERRIT)
2017/01/04 10:56:06
Could use this->numCols() instead.
a.suchit
2017/01/05 03:34:31
Done.
|
| + m_grid[rowIndex].row.grow(numCols); |
| + } |
| bool rowHasOnlySpanningCells(unsigned); |
| unsigned calcRowHeightHavingOnlySpanningCells(unsigned, |