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

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

Issue 2726103003: [css-grid] Implement transferred size part of Implied Minimum Size (Closed)
Patch Set: Swap order in condition 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/LayoutTests/fast/css-grid-layout/grid-automatic-minimum-intrinsic-aspect-ratio.html ('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/GridTrackSizingAlgorithm.cpp
diff --git a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
index 51a09fbfa70d13f892d5095af0c8fe3bf4b9bdd6..1664c868cba5f4cbd255fec17eafee02b85130b9 100644
--- a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
+++ b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
@@ -376,8 +376,18 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::minSizeForChild(
isRowAxis
? child.styleRef().overflowInlineDirection() == EOverflow::kVisible
: child.styleRef().overflowBlockDirection() == EOverflow::kVisible;
- if (!childSize.isAuto() || (childMinSize.isAuto() && overflowIsVisible))
+ if (!childSize.isAuto() || (childMinSize.isAuto() && overflowIsVisible)) {
+ if (child.isLayoutReplaced() && childSize.isAuto()) {
+ // If the box has an aspect ratio and no specified size, its automatic
+ // minimum size is the smaller of its content size and its transferred
+ // size.
+ return isRowAxis ? std::min(child.intrinsicLogicalWidth(),
+ minContentForChild(child))
+ : std::min(child.intrinsicLogicalHeight(),
+ minContentForChild(child));
+ }
return minContentForChild(child);
+ }
bool overrideSizeHasChanged =
updateOverrideContainingBlockContentSizeForChild(child,
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-automatic-minimum-intrinsic-aspect-ratio.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698