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

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

Issue 1921973005: [css tables] Don't pass table width increase due to % columns to parents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge ToT Created 4 years, 7 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
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index ef0b734e20ebfcd055a2551ba3161d7942ca2b59..61e9d0e554163981d2bc15f2ae54d5c9ab764360 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -282,7 +282,13 @@ void LayoutTable::updateLogicalWidth()
availableContentLogicalWidth = shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, toLayoutBlockFlow(cb));
// Ensure we aren't bigger than our available width.
- setLogicalWidth(LayoutUnit(std::min(availableContentLogicalWidth, maxPreferredLogicalWidth()).floor()));
+ LayoutUnit maxWidth = maxPreferredLogicalWidth();
+ // scaledWidthFromPercentColumns depends on m_layoutStruct in TableLayoutAlgorithmAuto, which
+ // maxPreferredLogicalWidth fills in. So scaledWidthFromPercentColumns has to be called after
+ // maxPreferredLogicalWidth.
+ LayoutUnit scaledWidth = m_tableLayout->scaledWidthFromPercentColumns() + bordersPaddingAndSpacingInRowDirection();
+ maxWidth = std::max(scaledWidth, maxWidth);
+ setLogicalWidth(LayoutUnit(std::min(availableContentLogicalWidth, maxWidth).floor()));
}
// Ensure we aren't bigger than our max-width style.

Powered by Google App Engine
This is Rietveld 408576698