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

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

Issue 2528253003: [table] Stretching tables when needed due to self-alignment properties (Closed)
Patch Set: Applied suggested changes. Created 4 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: 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 9ae716577e0dd6ffa1862617eff1887fbd144cd2..03d0755c2ad75e6fb2db1de44d5c3a05212a6017 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -306,8 +306,12 @@ void LayoutTable::updateLogicalWidth() {
LayoutUnit scaledWidth = m_tableLayout->scaledWidthFromPercentColumns() +
bordersPaddingAndSpacingInRowDirection();
maxWidth = std::max(scaledWidth, maxWidth);
- setLogicalWidth(
- LayoutUnit(std::min(availableContentLogicalWidth, maxWidth).floor()));
+ if (hasStretchedLogicalWidth()) {
dgrogan 2016/11/30 01:03:22 I don't know if this is the right behavior or not.
+ setLogicalWidth(availableContentLogicalWidth);
+ } else {
+ setLogicalWidth(
+ LayoutUnit(std::min(availableContentLogicalWidth, maxWidth).floor()));
+ }
}
// Ensure we aren't bigger than our max-width style.
@@ -461,11 +465,16 @@ void LayoutTable::layoutSection(LayoutTableSection& section,
LayoutUnit LayoutTable::logicalHeightFromStyle() const {
LayoutUnit computedLogicalHeight;
- Length logicalHeightLength = style()->logicalHeight();
- if (logicalHeightLength.isIntrinsic() ||
- (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())) {
- computedLogicalHeight =
- convertStyleLogicalHeightToComputedHeight(logicalHeightLength);
+ if (hasOverrideLogicalContentHeight()) {
+ computedLogicalHeight = overrideLogicalContentHeight();
+ } else {
+ Length logicalHeightLength = style()->logicalHeight();
+ if (logicalHeightLength.isIntrinsic() ||
+ (logicalHeightLength.isSpecified() &&
+ logicalHeightLength.isPositive())) {
+ computedLogicalHeight =
+ convertStyleLogicalHeightToComputedHeight(logicalHeightLength);
+ }
}
Length logicalMaxHeightLength = style()->logicalMaxHeight();

Powered by Google App Engine
This is Rietveld 408576698