Index: Source/core/rendering/RenderFlexibleBox.cpp |
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp |
index 2395e4a874a331f929f40bc64fa489fd9b48fc2c..ad224368fd5a11e1116fd7f08adeb02a30dd4f1b 100644 |
--- a/Source/core/rendering/RenderFlexibleBox.cpp |
+++ b/Source/core/rendering/RenderFlexibleBox.cpp |
@@ -96,6 +96,16 @@ void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt |
// FIXME: We're ignoring flex-basis here and we shouldn't. We can't start honoring it though until |
// the flex shorthand stops setting it to 0. |
// See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/240765. |
+ float totalChildHeight = 0; |
+ |
+ for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { |
+ if (child->isOutOfFlowPositioned()) |
+ continue; |
+ totalChildHeight += child->style()->height().value(); |
tony
2014/05/19 16:14:43
Is this correct? What about min-height? Also, it
harpreet.sk
2014/07/18 15:46:48
Sorry this is incorrect. It not correct to use hei
|
+ } |
+ |
+ bool boxMightWrap = totalChildHeight > this->style()->height().value(); |
+ |
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { |
if (child->isOutOfFlowPositioned()) |
continue; |
@@ -115,7 +125,7 @@ void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt |
minLogicalWidth += minPreferredLogicalWidth; |
} else { |
minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth); |
- if (isMultiline()) { |
+ if (isMultiline() && boxMightWrap) { |
tony
2014/05/19 16:14:43
If boxMightWrap is true, then we assume that all t
harpreet.sk
2014/07/18 15:46:49
Done.
|
// For multiline, the max preferred width is if you never break between items. |
maxLogicalWidth += maxPreferredLogicalWidth; |
} else |