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

Side by Side Diff: sky/engine/core/rendering/RenderFlexibleBox.cpp

Issue 876663003: Remove layoutBlock. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/rendering/RenderFlexibleBox.h ('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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // Flex items that were previously stretching need to be relayed out so we can compute new available cross axis space. 206 // Flex items that were previously stretching need to be relayed out so we can compute new available cross axis space.
207 // This is only necessary for stretching since other alignment values do n't change the size of the box. 207 // This is only necessary for stretching since other alignment values do n't change the size of the box.
208 for (RenderBox* child = firstChildBox(); child; child = child->nextSibli ngBox()) { 208 for (RenderBox* child = firstChildBox(); child; child = child->nextSibli ngBox()) {
209 ItemPosition previousAlignment = resolveAlignment(oldStyle, child->s tyle()); 209 ItemPosition previousAlignment = resolveAlignment(oldStyle, child->s tyle());
210 if (previousAlignment == ItemPositionStretch && previousAlignment != resolveAlignment(style(), child->style())) 210 if (previousAlignment == ItemPositionStretch && previousAlignment != resolveAlignment(style(), child->style()))
211 child->setChildNeedsLayout(MarkOnlyThis); 211 child->setChildNeedsLayout(MarkOnlyThis);
212 } 212 }
213 } 213 }
214 } 214 }
215 215
216 void RenderFlexibleBox::layoutBlock(bool relayoutChildren) 216 void RenderFlexibleBox::layout()
217 { 217 {
218 ASSERT(needsLayout()); 218 ASSERT(needsLayout());
219 219
220 if (!relayoutChildren && simplifiedLayout()) 220 if (simplifiedLayout())
221 return; 221 return;
222 222
223 if (updateLogicalWidthAndColumnWidth()) 223 bool relayoutChildren = updateLogicalWidthAndColumnWidth();
224 relayoutChildren = true;
225
226 LayoutUnit previousHeight = logicalHeight(); 224 LayoutUnit previousHeight = logicalHeight();
227 setLogicalHeight(borderAndPaddingLogicalHeight()); 225 setLogicalHeight(borderAndPaddingLogicalHeight());
228 226
229 { 227 {
230 LayoutState state(*this, locationOffset()); 228 LayoutState state(*this, locationOffset());
231 229
232 m_numberOfInFlowChildrenOnFirstLine = -1; 230 m_numberOfInFlowChildrenOnFirstLine = -1;
233 231
234 RenderBlock::startDelayUpdateScrollInfo(); 232 RenderBlock::startDelayUpdateScrollInfo();
235 233
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 ASSERT(child); 1292 ASSERT(child);
1295 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1293 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1296 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1294 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1297 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1295 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1298 adjustAlignmentForChild(child, newOffset - originalOffset); 1296 adjustAlignmentForChild(child, newOffset - originalOffset);
1299 } 1297 }
1300 } 1298 }
1301 } 1299 }
1302 1300
1303 } 1301 }
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderFlexibleBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698