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

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: Removed another incorrect assert. Created 3 years, 10 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/Source/core/layout/LayoutFullScreen.h ('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/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index ea658b4d04d0874bae590dd6f353218885e48aeb..c2ce30f510acdbb0de60eb043a694a9d8921ddd7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -297,17 +297,21 @@ void LayoutTable::updateLogicalWidth() {
availableContentLogicalWidth = shrinkLogicalWidthToAvoidFloats(
marginStart, marginEnd, toLayoutBlockFlow(cb));
- // Ensure we aren't bigger than our available width.
- 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()));
+ if (hasStretchedLogicalWidth()) {
+ setLogicalWidth(availableContentLogicalWidth);
+ } else {
+ // Ensure we aren't bigger than our available width.
+ 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.
@@ -465,11 +469,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();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFullScreen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698