Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1344)

Unified Diff: Source/core/rendering/RenderTableSection.cpp

Issue 744493002: Let RenderTable reach table cells needing overflow recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout test crash Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderTableSection.cpp
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp
index 3d10b9e684a3f0eea39b64db6f858918bcc23d1b..336558b72d651b4cf8209c3334bbe8f84bbaf55d 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -1129,6 +1129,30 @@ void RenderTableSection::computeOverflowFromCells(unsigned totalRows, unsigned n
ASSERT(hasOverflowingCell == this->hasOverflowingCell());
}
+bool RenderTableSection::recalcOverflowForCellsAfterStyleChange()
+{
+ unsigned totalRows = m_grid.size();
+ unsigned numEffCols = table()->numEffCols();
+ bool childrenOverflowChanged = false;
+
+ // Now that our height has been determined, add in overflow from cells.
+ for (unsigned r = 0; r < totalRows; r++) {
+ for (unsigned c = 0; c < numEffCols; c++) {
+ CellStruct& cs = cellAt(r, c);
+ RenderTableCell* cell = cs.primaryCell();
+ if (!cell || cs.inColSpan || !cell->needsOverflowRecalcAfterStyleChange())
+ continue;
+ if (cell->recalcOverflowAfterStyleChange())
+ childrenOverflowChanged = true;
+ }
+ }
Julien - ping for review 2014/11/22 02:35:04 Recomputing the overflow is now O(columns*rows) :(
Xianzhu 2014/11/24 17:23:00 I think it's [O(columns*rows) of cost_of_testing
+
+ if (childrenOverflowChanged)
+ computeOverflowFromCells(totalRows, numEffCols);
+
+ return childrenOverflowChanged;
+}
+
int RenderTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) const
{
unsigned totalCols = table()->numEffCols();

Powered by Google App Engine
This is Rietveld 408576698