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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 2219433002: [css-flexbox] Have to use forceChildLayout to force layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/bug633212.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 continue; 1241 continue;
1242 } 1242 }
1243 1243
1244 ChildLayoutType layoutType = relayoutChildren ? ForceLayout : LayoutIfNe eded; 1244 ChildLayoutType layoutType = relayoutChildren ? ForceLayout : LayoutIfNe eded;
1245 1245
1246 // If this condition is true, then computeMainAxisExtentForChild will ca ll child.intrinsicContentLogicalHeight() 1246 // If this condition is true, then computeMainAxisExtentForChild will ca ll child.intrinsicContentLogicalHeight()
1247 // and child.scrollbarLogicalHeight(), so if the child has intrinsic min /max/preferred size, 1247 // and child.scrollbarLogicalHeight(), so if the child has intrinsic min /max/preferred size,
1248 // run layout on it now to make sure its logical height and scroll bars are up to date. 1248 // run layout on it now to make sure its logical height and scroll bars are up to date.
1249 if (childHasIntrinsicMainAxisSize(*child) && child->needsLayout()) { 1249 if (childHasIntrinsicMainAxisSize(*child) && child->needsLayout()) {
1250 child->clearOverrideSize(); 1250 child->clearOverrideSize();
1251 child->layoutIfNeeded(); 1251 child->forceChildLayout();
1252 cacheChildMainSize(*child); 1252 cacheChildMainSize(*child);
1253 layoutType = LayoutIfNeeded; 1253 layoutType = LayoutIfNeeded;
1254 } 1254 }
1255 1255
1256 FlexItem flexItem = constructFlexItem(*child, layoutType); 1256 FlexItem flexItem = constructFlexItem(*child, layoutType);
1257 if (isMultiline() && sumHypotheticalMainSize + flexItem.hypotheticalMain AxisMarginBoxSize() > lineBreakLength && lineHasInFlowItem) 1257 if (isMultiline() && sumHypotheticalMainSize + flexItem.hypotheticalMain AxisMarginBoxSize() > lineBreakLength && lineHasInFlowItem)
1258 break; 1258 break;
1259 orderedChildren.append(flexItem); 1259 orderedChildren.append(flexItem);
1260 lineHasInFlowItem = true; 1260 lineHasInFlowItem = true;
1261 sumFlexBaseSize += flexItem.flexBaseMarginBoxSize(); 1261 sumFlexBaseSize += flexItem.flexBaseMarginBoxSize();
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 DCHECK(child); 1922 DCHECK(child);
1923 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1923 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1924 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1924 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1925 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1925 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1926 adjustAlignmentForChild(*child, newOffset - originalOffset); 1926 adjustAlignmentForChild(*child, newOffset - originalOffset);
1927 } 1927 }
1928 } 1928 }
1929 } 1929 }
1930 1930
1931 } // namespace blink 1931 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/bug633212.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698