Index: Source/core/layout/LayoutBlockFlow.cpp |
diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp |
index 22dbcd85698ad21450b151b46042fa3f1f1c1f76..3f8d0e6132e566e7b3188b564ad8a5106e3b4fa7 100644 |
--- a/Source/core/layout/LayoutBlockFlow.cpp |
+++ b/Source/core/layout/LayoutBlockFlow.cpp |
@@ -374,6 +374,16 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit & |
else |
layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); |
+ if (needsRecalcLogicalWidthAfterLayoutChildren()) { |
+ // In perpendicular writing-mode, min-content logicalWidth depends on the child's logicalHeight, |
+ // so logicalWidth needs to be updated after children layout is done. |
+ // Strictly speaking, children need re-layout if logicalWidth is changed, but in most cases, |
+ // perpendicular children do not re-flow according to parent's logicalWidth. |
+ clearNeedsRecalcLogicalWidthAfterLayoutChildren(); |
+ setPreferredLogicalWidthsDirty(MarkOnlyThis); |
+ updateLogicalWidthAndColumnWidth(); |
+ } |
+ |
// Expand our intrinsic height to encompass floats. |
if (lowestFloatLogicalBottom() > (logicalHeight() - afterEdge) && createsNewFormattingContext()) |
setLogicalHeight(lowestFloatLogicalBottom() + afterEdge); |