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

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

Issue 1368243002: Don't deduct min-width from the available width for empty cells (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 5 years, 2 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 | « third_party/WebKit/LayoutTests/fast/table/colspan-with-empty-cells-needing-extra-width-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
diff --git a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
index 009e07bd881a361f44e4c5c2f4e2b99ba47e6bf6..244d9f4a9bbaf1b9e3fea1b14d39bb324cd1bc1c 100644
--- a/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
+++ b/third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp
@@ -545,8 +545,9 @@ void TableLayoutAlgorithmAuto::layout()
} else {
numAuto++;
totalAuto += m_layoutStruct[i].clampedEffectiveMaxLogicalWidth();
- allocAuto += cellLogicalWidth;
}
+ if (!m_layoutStruct[i].columnHasNoCells)
+ allocAuto += cellLogicalWidth;
break;
default:
break;
@@ -593,13 +594,12 @@ void TableLayoutAlgorithmAuto::layout()
}
// Give each auto width column its share of the available width, non-empty columns then empty columns.
- if (available > 0 && numAuto) {
+ if (available > 0 && (numAuto || numAutoEmptyCellsOnly)) {
available += allocAuto;
- distributeWidthToColumns<float, Auto, NonEmptyCells, InitialWidth, StartToEnd>(available, totalAuto);
- }
- if (available > 0 && numAutoEmptyCellsOnly) {
- unsigned total = numAutoEmptyCellsOnly;
- distributeWidthToColumns<unsigned, Auto, EmptyCells, InitialWidth, StartToEnd>(available, total);
+ if (numAuto)
+ distributeWidthToColumns<float, Auto, NonEmptyCells, InitialWidth, StartToEnd>(available, totalAuto);
+ if (numAutoEmptyCellsOnly)
+ distributeWidthToColumns<unsigned, Auto, EmptyCells, InitialWidth, StartToEnd>(available, numAutoEmptyCellsOnly);
}
// Any remaining available width expands fixed width, percent width, and non-empty auto width columns, in that order.
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/colspan-with-empty-cells-needing-extra-width-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698