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

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

Issue 815833005: [css-grid] Handle min-content/max-content with orthogonal flows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New approach (Step3) - Assumed row track's breadth for intrinsic size computation. Created 5 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 4a4f729789e74e74629b83a48ea724f4c655a1f7..b93226f6e35bab58ec73eb9979095fdaf898a044 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2040,17 +2040,18 @@ void LayoutBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues)
return;
}
+ LayoutUnit containerWidthInInlineDirection = containerLogicalWidth;
+ if (hasPerpendicularContainingBlock)
+ containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight();
+
// Width calculations
if (treatAsReplaced) {
computedValues.m_extent = logicalWidthLength.value() + borderAndPaddingLogicalWidth();
- } else if (parent()->isLayoutGrid() && style()->logicalWidth().isAuto() && style()->logicalMinWidth().isAuto() && style()->overflowX() == OVISIBLE && containerLogicalWidth < minPreferredLogicalWidth()) {
+ } else if (parent()->isLayoutGrid() && style()->logicalWidth().isAuto() && style()->logicalMinWidth().isAuto() && style()->overflowX() == OVISIBLE && containerWidthInInlineDirection < minPreferredLogicalWidth()) {
// TODO (lajava) Move this logic to the LayoutGrid class.
// Implied minimum size of Grid items.
- computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogicalWidth(), containerLogicalWidth, cb);
+ computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogicalWidth(), containerWidthInInlineDirection, cb);
} else {
- LayoutUnit containerWidthInInlineDirection = containerLogicalWidth;
- if (hasPerpendicularContainingBlock)
- containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight();
LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize, styleToUse.logicalWidth(), containerWidthInInlineDirection, cb);
computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth, containerWidthInInlineDirection, cb);
}

Powered by Google App Engine
This is Rietveld 408576698