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

Unified Diff: Source/WebCore/rendering/AutoTableLayout.cpp

Issue 10274014: Merge 114574 - REGRESSION(102040): Auto-table layout with percent width doesn't shrink-to-fit conte… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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 | « LayoutTests/fast/table/td-width-fifty-percent-regression-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/AutoTableLayout.cpp
===================================================================
--- Source/WebCore/rendering/AutoTableLayout.cpp (revision 115666)
+++ Source/WebCore/rendering/AutoTableLayout.cpp (working copy)
@@ -402,13 +402,23 @@
}
} else if (allColsArePercent) {
// In this case, we just split the colspan's min amd max widths following the percentage.
+ int allocatedMinLogicalWidth = 0;
+ float allocatedMaxLogicalWidth = 0;
for (unsigned pos = effCol; pos < lastCol; ++pos) {
ASSERT(m_layoutStruct[pos].logicalWidth.isPercent() || m_layoutStruct[pos].effectiveLogicalWidth.isPercent());
// |allColsArePercent| means that either the logicalWidth *or* the effectiveLogicalWidth are percents, handle both of them here.
float percent = m_layoutStruct[pos].logicalWidth.isPercent() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
- m_layoutStruct[pos].effectiveMinLogicalWidth = max(m_layoutStruct[pos].effectiveMinLogicalWidth, static_cast<int>(percent * cellMinLogicalWidth / totalPercent));
- m_layoutStruct[pos].effectiveMaxLogicalWidth = percent * cellMaxLogicalWidth / totalPercent;
+ int columnMinLogicalWidth = static_cast<int>(percent * cellMinLogicalWidth / totalPercent);
+ float columnMaxLogicalWidth = percent * cellMaxLogicalWidth / totalPercent;
+ m_layoutStruct[pos].effectiveMinLogicalWidth = max(m_layoutStruct[pos].effectiveMinLogicalWidth, columnMinLogicalWidth);
+ m_layoutStruct[pos].effectiveMaxLogicalWidth = columnMaxLogicalWidth;
+ allocatedMinLogicalWidth += columnMinLogicalWidth;
+ allocatedMaxLogicalWidth += columnMaxLogicalWidth;
}
+ ASSERT(allocatedMinLogicalWidth <= cellMinLogicalWidth);
+ ASSERT(allocatedMaxLogicalWidth <= cellMaxLogicalWidth);
+ cellMinLogicalWidth -= allocatedMinLogicalWidth;
+ cellMaxLogicalWidth -= allocatedMaxLogicalWidth;
} else {
float remainingMaxLogicalWidth = spanMaxLogicalWidth;
int remainingMinLogicalWidth = spanMinLogicalWidth;
« no previous file with comments | « LayoutTests/fast/table/td-width-fifty-percent-regression-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698