Chromium Code Reviews| 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 bdb5e1a47b3f6ee2ea25d9867e052bc7588f25fa..bc3a8c0fcd1c9ee1371fd8fb0f420f20e26aae29 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp |
| @@ -972,10 +972,9 @@ void LayoutTableSection::layoutRows() |
| rowLayoutObject->updateLayerTransformAfterLayout(); |
| rowLayoutObject->clearAllOverflows(); |
| rowLayoutObject->addVisualEffectOverflow(); |
| + rowLayoutObject->setPaginationStrutPropagatedFromCell(LayoutUnit()); |
| } |
| - int rowHeightIncreaseForPagination = 0; |
| - |
| for (unsigned c = 0; c < nEffCols; c++) { |
| CellStruct& cs = cellAt(r, c); |
| LayoutTableCell* cell = cs.primaryCell(); |
| @@ -1050,18 +1049,6 @@ void LayoutTableSection::layoutRows() |
| cell->layoutIfNeeded(); |
| - // FIXME: Make pagination work with vertical tables. |
| - if (view()->layoutState()->pageLogicalHeight() && cell->logicalHeight() != rHeight) { |
| - // FIXME: Pagination might have made us change size. For now just shrink or grow the cell to fit without doing a relayout. |
| - // We'll also do a basic increase of the row height to accommodate the cell if it's bigger, but this isn't quite right |
| - // either. It's at least stable though and won't result in an infinite # of relayouts that may never stabilize. |
| - LayoutUnit oldLogicalHeight = cell->logicalHeight(); |
| - if (oldLogicalHeight > rHeight) |
| - rowHeightIncreaseForPagination = std::max<int>(rowHeightIncreaseForPagination, oldLogicalHeight - rHeight); |
| - cell->setLogicalHeight(rHeight); |
| - cell->computeOverflow(oldLogicalHeight, false); |
| - } |
| - |
| if (rowLayoutObject) |
| rowLayoutObject->addOverflowFromCell(cell); |
| @@ -1074,15 +1061,16 @@ void LayoutTableSection::layoutRows() |
| cell->setMayNeedPaintInvalidation(); |
| } |
| } |
| - if (rowHeightIncreaseForPagination) { |
| - for (unsigned rowIndex = r + 1; rowIndex <= totalRows; rowIndex++) |
| - m_rowPos[rowIndex] += rowHeightIncreaseForPagination; |
| - for (unsigned c = 0; c < nEffCols; ++c) { |
| - Vector<LayoutTableCell*, 1>& cells = cellAt(r, c).cells; |
| - for (size_t i = 0; i < cells.size(); ++i) { |
| - LayoutUnit oldLogicalHeight = cells[i]->logicalHeight(); |
| - cells[i]->setLogicalHeight(oldLogicalHeight + rowHeightIncreaseForPagination); |
| - cells[i]->computeOverflow(oldLogicalHeight, false); |
| + if (rowLayoutObject && rowLayoutObject->paginationStrutPropagatedFromCell()) { |
|
mstensho (USE GERRIT)
2016/02/03 14:38:48
I haven't reviewed this yet.
|
| + for (unsigned rowIndex = r; rowIndex <= totalRows; rowIndex++) { |
| + m_rowPos[rowIndex] += rowLayoutObject->paginationStrutPropagatedFromCell().toInt(); |
| + if (rowIndex == totalRows) |
| + continue; |
| + for (unsigned c = 0; c < nEffCols; ++c) { |
| + Vector<LayoutTableCell*, 1>& cells = cellAt(rowIndex, c).cells; |
| + for (size_t i = 0; i < cells.size(); ++i) { |
| + setLogicalPositionForCell(cells[i], c); |
| + } |
| } |
| } |
| } |