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

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

Issue 1971053003: Use new intrinsic content height when computing min-height: min-content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('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/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index 28090ecde820d2355c97689736368741834e006b..e8134f47117114199ad7eba49d503d2795bde7cc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -523,7 +523,9 @@ LayoutUnit LayoutFlexibleBox::computeMainAxisExtentForChild(const LayoutBox& chi
// We don't have to check for "auto" here - computeContentLogicalHeight will just return -1 for that case anyway.
// It's safe to access scrollbarLogicalHeight here because computeNextFlexLine will have already
// forced layout on the child.
- return child.computeContentLogicalHeight(sizeType, size, child.contentLogicalHeight()) + child.scrollbarLogicalHeight();
+ // We previously layed out the child if necessary (see computeNextFlexLine and the call to childHasIntrinsicMainAxisSize)
+ // so we can be sure that the two height calls here will return up-to-date data.
+ return child.computeContentLogicalHeight(sizeType, size, child.intrinsicContentLogicalHeight()) + child.scrollbarLogicalHeight();
}
// computeLogicalWidth always re-computes the intrinsic widths. However, when our logical width is auto,
// we can just use our cached value. So let's do that here. (Compare code in LayoutBlock::computePreferredLogicalWidths)
@@ -1233,7 +1235,7 @@ bool LayoutFlexibleBox::computeNextFlexLine(OrderedFlexItemList& orderedChildren
continue;
}
- // If this condition is true, then computeMainAxisExtentForChild will call child.contentLogicalHeight()
+ // If this condition is true, then computeMainAxisExtentForChild will call child.intrinsicContentLogicalHeight()
// and child.scrollbarLogicalHeight(), so if the child has intrinsic min/max/preferred size,
// run layout on it now to make sure its logical height and scroll bars are up-to-date.
if (childHasIntrinsicMainAxisSize(*child) && child->needsLayout()) {
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698