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 bbcf8f535af38fc826047c784e00c1691ea15bf9..bd79793380f4e7d67571d1eb9aa278e18006cfe4 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
| @@ -734,6 +734,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::splitEffectiveColumn(unsigned index, unsigned firstSpan) |
| { |
| // We split the column at |index|, taking |firstSpan| cells from the span. |
| @@ -844,6 +852,24 @@ LayoutTable::ColAndColGroup LayoutTable::slowColElementAtAbsoluteColumn(unsigned |
| return ColAndColGroup(); |
| } |
| +// Maps LayoutTableCol => absoluteColumnIndex, |
| +// an inverse of slowColElementAtAbsoluteColumn. |
|
Xianzhu
2016/03/28 00:44:42
Move the comment to header file.
atotic1
2016/03/29 17:05:16
Done.
|
| +unsigned LayoutTable::colElementToAbsoluteColumn(const LayoutTableCol * colElement) const |
|
Xianzhu
2016/03/28 00:44:42
Nit: remove the extra space before '*'.
atotic1
2016/03/29 17:05:16
Done.
|
| +{ |
| + unsigned col = 0; |
| + |
| + for (LayoutTableCol* columnLayoutObject = firstColumn(); columnLayoutObject; columnLayoutObject = columnLayoutObject->nextColumn()) { |
| + if (columnLayoutObject == colElement) |
| + break; |
|
Xianzhu
2016/03/28 00:44:42
Change this to 'return col';
atotic1
2016/03/29 17:05:16
Done.
|
| + if (columnLayoutObject->isTableColumnGroupWithColumnChildren()) { |
| + // Do nothing, span will increase with children |
|
Xianzhu
2016/03/28 00:44:42
The comment is not clear to me. How about:
//
atotic1
2016/03/29 17:05:16
Done.
|
| + } else { |
| + col += columnLayoutObject->span(); |
| + } |
| + } |
| + return col; |
|
Xianzhu
2016/03/28 00:44:41
Change this to:
ASSERT_NOT_REACHED();
return
atotic1
2016/03/29 17:05:16
Done.
|
| +} |
| + |
| void LayoutTable::recalcSections() const |
| { |
| ASSERT(m_needsSectionRecalc); |