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

Unified Diff: Source/core/layout/TableLayoutAlgorithmAuto.cpp

Issue 1181643007: Fix regression in unwinding overallocation on auto cells (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months 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
« no previous file with comments | « Source/core/layout/TableLayoutAlgorithmAuto.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/TableLayoutAlgorithmAuto.cpp
diff --git a/Source/core/layout/TableLayoutAlgorithmAuto.cpp b/Source/core/layout/TableLayoutAlgorithmAuto.cpp
index e10454b8856993ff9d37065bb189fd7f1ab060a0..450fe6fef269d70eccea5fa2f7b1842b9087220a 100644
--- a/Source/core/layout/TableLayoutAlgorithmAuto.cpp
+++ b/Source/core/layout/TableLayoutAlgorithmAuto.cpp
@@ -616,8 +616,10 @@ void TableLayoutAlgorithmAuto::layout()
// If we have overallocated, reduce every cell according to the difference between desired width and minwidth
// this seems to produce to the pixel exact results with IE. Wonder is some of this also holds for width distributing.
// This is basically the reverse of how we grew the cells.
- if (available < 0)
- shrinkColumnWidth(Auto, available);
+ if (available < 0) {
+ int autoWidthAvailable = available - static_cast<int>(totalAuto);
+ shrinkColumnWidth(Auto, autoWidthAvailable);
+ }
if (available < 0)
shrinkColumnWidth(Fixed, available);
if (available < 0)
@@ -632,7 +634,7 @@ void TableLayoutAlgorithmAuto::layout()
}
template<typename Total, LengthType lengthType, CellsToProcess cellsToProcess, DistributionMode distributionMode, DistributionDirection distributionDirection>
-void TableLayoutAlgorithmAuto::distributeWidthToColumns(int& available, Total total)
+void TableLayoutAlgorithmAuto::distributeWidthToColumns(int& available, Total& total)
{
// TODO(alancutter): Make this work correctly for calc lengths.
int nEffCols = static_cast<int>(m_table->numEffCols());
@@ -659,8 +661,8 @@ void TableLayoutAlgorithmAuto::distributeWidthToColumns(int& available, Total to
m_layoutStruct[i].computedLogicalWidth = (distributionMode == InitialWidth) ? cellLogicalWidth : m_layoutStruct[i].computedLogicalWidth + cellLogicalWidth;
// If we have run out of width to allocate we're done.
- // Also, any overallocation will be unwound later so no point in building up cells to unwind, just bail now.
- if (available <= 0 || total <= 0)
+ // TODO(rhogan): Extend this to Fixed as well.
+ if ((lengthType == Percent || lengthType == Auto) && (available <= 0 || total <= 0))
return;
}
}
« no previous file with comments | « Source/core/layout/TableLayoutAlgorithmAuto.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698