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

Unified Diff: Source/core/rendering/RenderFlexibleBox.cpp

Issue 289903007: Inline flexbox width is wrongly calculated when wrapping vertically (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
Index: Source/core/rendering/RenderFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index 2a6c7056fe62f5936d31f67d7d298d59b86f3769..53b20e2c0062f8c6cab437549541894a34a481a2 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -116,11 +116,7 @@ void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt
minLogicalWidth += minPreferredLogicalWidth;
} else {
minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth);
- if (isMultiline()) {
- // For multiline, the max preferred width is if you never break between items.
- maxLogicalWidth += maxPreferredLogicalWidth;
- } else
- maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth);
+ maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth);
}
}
@@ -1119,8 +1115,16 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
} else {
childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(child) + crossAxisMarginExtentForChild(child);
}
- if (!isColumnFlow())
+ if (!isColumnFlow()) {
setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwareBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + crossAxisScrollbarExtent()));
+ } else if (isMultiline() && !style()->logicalWidth().isSpecified()) {
tony 2014/07/21 17:50:59 I don't think this is correct. This part of the s
harpreet.sk 2014/07/22 10:10:23 Acknowledged.
+ LayoutUnit w = std::max(logicalWidth(), crossAxisOffset + flowAwareBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + crossAxisScrollbarExtent());
+ bool hasPerpendicularContainingBlock = containingBlock()->isHorizontalWritingMode() != isHorizontalWritingMode();
+ LayoutUnit containerWidthInInlineDirection = std::max<LayoutUnit>(0, containingBlockLogicalWidthForContent());
+ if (hasPerpendicularContainingBlock)
+ containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight();
+ setLogicalWidth(constrainLogicalWidthByMinMax(w, containerWidthInInlineDirection, containingBlock()));
+ }
maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAxisMarginBoxExtent);
mainAxisOffset += flowAwareMarginStartForChild(child);

Powered by Google App Engine
This is Rietveld 408576698