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

Unified Diff: Source/core/layout/LayoutBlockFlow.cpp

Issue 1121173002: Fix shrink-to-fit when children's writing-mode is orthogonal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 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 | « Source/core/layout/LayoutBlock.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698