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

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

Issue 1052363002: Fix a FIXME - correctly calculate the main size when writing modes are involved. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test should be fixed now Created 5 years, 9 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 | « LayoutTests/css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/Source/core/layout/LayoutFlexibleBox.cpp b/Source/core/layout/LayoutFlexibleBox.cpp
index 785b529db295ef53fc7076424b02c21053b9cc98..a30f5d91022e034adc4ec194e96b3591ff85a4cb 100644
--- a/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/Source/core/layout/LayoutFlexibleBox.cpp
@@ -410,9 +410,12 @@ LayoutUnit LayoutFlexibleBox::mainAxisContentExtent(LayoutUnit contentLogicalHei
LayoutUnit LayoutFlexibleBox::computeMainAxisExtentForChild(LayoutBox& child, SizeType sizeType, const Length& size)
{
- // FIXME: This is wrong for orthogonal flows. It should use the flexbox's writing-mode, not the child's in order
- // to figure out the logical height/width.
- if (isColumnFlow()) {
+ // If we have a horizontal flow, that means the main size is the width.
+ // That's the logical width for horizontal writing modes, and the logical height in vertical writing modes.
+ // For a vertical flow, main size is the height, so it's the inverse.
+ // So we need the logical width if we have a horizontal flow and horizontal writing mode, or vertical flow and vertical writing mode.
+ // Otherwise we need the logical height.
+ if (isHorizontalFlow() != child.styleRef().isHorizontalWritingMode()) {
// We don't have to check for "auto" here - computeContentLogicalHeight will just return -1 for that case anyway.
if (size.isIntrinsic())
child.layoutIfNeeded();
« no previous file with comments | « LayoutTests/css3/flexbox/orthogonal-writing-modes-and-intrinsic-sizing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698