Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
| index ae3e5c0d4391dc2582f8f17f34240e74cad2ecce..07e2a341b885d2c3b3aa839d2905fa0ac220c7d0 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
| @@ -728,6 +728,14 @@ LayoutTableSection* LayoutTable::topNonEmptySection() const |
| return section; |
| } |
| +LayoutTableSection* LayoutTable::bottomNonEmptySection() const |
| +{ |
| + LayoutTableSection* section = bottomSection(); |
| + if (section && !section->numRows()) |
| + section = sectionAbove(section, SkipEmptySections); |
| + return section; |
| +} |
| + |
| void LayoutTable::splitColumn(unsigned position, unsigned firstSpan) |
| { |
| // We split the column at "position", taking "firstSpan" cells from the span. |
| @@ -838,6 +846,23 @@ LayoutTable::ColAndColGroup LayoutTable::slowColElement(unsigned col) const |
| return ColAndColGroup(); |
| } |
| +// Inverse of slowColElement: |
| +// maps LayoutTableCol to columnIndex useful for columnPositions |
| +unsigned LayoutTable::colElementToCol(const LayoutTableCol * colElement) const |
|
Xianzhu
2016/02/23 22:58:27
Nit: extra space before '*'.
atotic1
2016/03/15 16:50:47
Done.
|
| +{ |
| + unsigned col = 0; |
| + unsigned i; |
| + for (i = 0; i < m_columnLayoutObjects.size() && col < m_columns.size(); i++) { |
|
Xianzhu
2016/02/23 22:58:27
The col < m_columns.size() seems incorrect. m_colu
Xianzhu
2016/02/23 22:58:27
The following style is preferred:
for (const Layou
|
| + if (colElement == m_columnLayoutObjects[i]) { |
| + return col; |
| + } |
| + if (!m_columnLayoutObjects[i]->isTableColumnGroup()) |
|
Xianzhu
2016/02/23 22:58:27
Is this condition correct? It seems different from
|
| + col += m_columnLayoutObjects[i]->span(); |
| + } |
| + |
| + return m_columns.size() - 1; |
| +} |
| + |
| void LayoutTable::recalcSections() const |
| { |
| ASSERT(m_needsSectionRecalc); |