Chromium Code Reviews| Index: Source/core/rendering/RenderTableSection.cpp |
| diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp |
| index f1983f60442b97de4e318913bdadcee70a486cf4..b6da9bb7de2741d918057a44db414870693c2d04 100644 |
| --- a/Source/core/rendering/RenderTableSection.cpp |
| +++ b/Source/core/rendering/RenderTableSection.cpp |
| @@ -943,9 +943,10 @@ void RenderTableSection::layoutRows() |
| // Set the width of our section now. The rows will also be this width. |
| setLogicalWidth(table()->contentLogicalWidth()); |
| - m_overflow.clear(); |
| + |
| + // We will clear and recompute overflow in computeOverflowFromCells(). |
| + // Clear m_overflowCells early to avoid stale pointers from it. |
| m_overflowingCells.clear(); |
|
Julien - ping for review
2014/12/03 19:44:36
My previous comment was hinting at just removing t
Xianzhu
2014/12/03 22:56:35
Done.
|
| - m_forceSlowPaintPathWithOverflowingCell = false; |
| int vspacing = table()->vBorderSpacing(); |
| unsigned nEffCols = table()->numEffCols(); |
| @@ -960,8 +961,6 @@ void RenderTableSection::layoutRows() |
| rowRenderer->setLogicalWidth(logicalWidth()); |
| rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing); |
| rowRenderer->updateLayerTransformAfterLayout(); |
| - rowRenderer->clearAllOverflows(); |
| - rowRenderer->addVisualEffectOverflow(); |
| } |
| int rowHeightIncreaseForPagination = 0; |
| @@ -1053,9 +1052,6 @@ void RenderTableSection::layoutRows() |
| cell->computeOverflow(oldLogicalHeight, false); |
| } |
| - if (rowRenderer) |
| - rowRenderer->addOverflowFromCell(cell); |
| - |
| LayoutSize childOffset(cell->location() - oldCellRect.location()); |
| if (childOffset.width() || childOffset.height()) { |
| // If the child moved, we have to issue paint invalidations to it as well as any floating/positioned |
| @@ -1077,6 +1073,9 @@ void RenderTableSection::layoutRows() |
| } |
| } |
| } |
| + |
| + if (rowRenderer) |
| + rowRenderer->recomputeOverflow(); |
| } |
| ASSERT(!needsLayout()); |
| @@ -1098,6 +1097,10 @@ void RenderTableSection::computeOverflowFromCells(unsigned totalRows, unsigned n |
| unsigned totalCellsCount = nEffCols * totalRows; |
| unsigned maxAllowedOverflowingCellsCount = totalCellsCount < gMinTableSizeToUseFastPaintPathWithOverflowingCell ? 0 : gMaxAllowedOverflowingCellRatioForFastPaintPath * totalCellsCount; |
| + m_overflow.clear(); |
| + m_overflowingCells.clear(); |
| + m_forceSlowPaintPathWithOverflowingCell = false; |
| + |
| #if ENABLE(ASSERT) |
| bool hasOverflowingCell = false; |
| #endif |
| @@ -1129,6 +1132,41 @@ void RenderTableSection::computeOverflowFromCells(unsigned totalRows, unsigned n |
| ASSERT(hasOverflowingCell == this->hasOverflowingCell()); |
| } |
| +bool RenderTableSection::recalcChildOverflowAfterStyleChange() |
| +{ |
| + ASSERT(childNeedsOverflowRecalcAfterStyleChange()); |
| + clearChildNeedsOverflowRecalcAfterStyleChange(); |
| + |
| + unsigned totalRows = m_grid.size(); |
| + unsigned numEffCols = table()->numEffCols(); |
| + bool childrenOverflowChanged = false; |
| + |
| + for (unsigned r = 0; r < totalRows; r++) { |
| + RenderTableRow* rowRenderer = rowRendererAt(r); |
| + if (!rowRenderer || !rowRenderer->childNeedsOverflowRecalcAfterStyleChange()) |
| + continue; |
| + |
| + rowRenderer->clearChildNeedsOverflowRecalcAfterStyleChange(); |
| + |
| + bool rowChildrenOverflowChanged = false; |
| + for (unsigned c = 0; c < numEffCols; c++) { |
| + CellStruct& cs = cellAt(r, c); |
| + RenderTableCell* cell = cs.primaryCell(); |
| + if (!cell || cs.inColSpan || !cell->needsOverflowRecalcAfterStyleChange()) |
| + continue; |
| + rowChildrenOverflowChanged |= cell->recalcOverflowAfterStyleChange(); |
| + } |
| + if (rowChildrenOverflowChanged) |
| + rowRenderer->recomputeOverflow(); |
| + childrenOverflowChanged |= rowChildrenOverflowChanged; |
| + } |
| + |
| + if (childrenOverflowChanged) |
| + computeOverflowFromCells(totalRows, numEffCols); |
| + |
| + return childrenOverflowChanged; |
| +} |
| + |
| int RenderTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) const |
| { |
| unsigned totalCols = table()->numEffCols(); |