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

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

Issue 2694463002: [css-flexbox] Correctly size flex rows with scrollbars (Closed)
Patch Set: 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/TestExpectations ('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 58984f54889bbc7650f3105f84006ceff7f3e2e5..1f384597ed8d7af0f9246bb13893f5f51586c0ad 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -484,27 +484,21 @@ LayoutUnit LayoutFlexibleBox::crossAxisExtentForChild(
return isHorizontalFlow() ? child.size().height() : child.size().width();
}
-static inline LayoutUnit constrainedChildIntrinsicContentLogicalHeight(
- const LayoutBox& child,
- LayoutUnit childIntrinsicContentLogicalHeight) {
- // TODO(cbiesinger): scrollbar height?
- return child.constrainLogicalHeightByMinMax(
- childIntrinsicContentLogicalHeight +
- child.borderAndPaddingLogicalHeight(),
- childIntrinsicContentLogicalHeight);
-}
-
LayoutUnit LayoutFlexibleBox::childIntrinsicLogicalHeight(
const LayoutBox& child) const {
// This should only be called if the logical height is the cross size
DCHECK(!hasOrthogonalFlow(child));
if (needToStretchChildLogicalHeight(child)) {
LayoutUnit childIntrinsicContentLogicalHeight;
- if (!child.styleRef().containsSize())
+ if (!child.styleRef().containsSize()) {
childIntrinsicContentLogicalHeight =
child.intrinsicContentLogicalHeight();
- return constrainedChildIntrinsicContentLogicalHeight(
- child, childIntrinsicContentLogicalHeight);
+ }
+ LayoutUnit childIntrinsicLogicalHeight =
+ childIntrinsicContentLogicalHeight + child.scrollbarLogicalHeight() +
+ child.borderAndPaddingLogicalHeight();
+ return child.constrainLogicalHeightByMinMax(
+ childIntrinsicLogicalHeight, childIntrinsicContentLogicalHeight);
}
return child.logicalHeight();
}
@@ -1838,8 +1832,7 @@ void LayoutFlexibleBox::layoutAndPlaceChildren(
childCrossAxisMarginBoxExtent = maxAscent + maxDescent;
} else {
childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(*child) +
- crossAxisMarginExtentForChild(*child) +
- crossAxisScrollbarExtentForChild(*child);
+ crossAxisMarginExtentForChild(*child);
}
if (!isColumnFlow())
setLogicalHeight(std::max(
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698