| OLD | NEW |
| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 void RenderFlexibleBox::layoutBlock(bool relayoutChildren) | 227 void RenderFlexibleBox::layoutBlock(bool relayoutChildren) |
| 228 { | 228 { |
| 229 ASSERT(needsLayout()); | 229 ASSERT(needsLayout()); |
| 230 | 230 |
| 231 if (!relayoutChildren && simplifiedLayout()) | 231 if (!relayoutChildren && simplifiedLayout()) |
| 232 return; | 232 return; |
| 233 | 233 |
| 234 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); | 234 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); |
| 235 | 235 |
| 236 setMayNeedInvalidation(true); |
| 237 |
| 236 if (updateLogicalWidthAndColumnWidth()) | 238 if (updateLogicalWidthAndColumnWidth()) |
| 237 relayoutChildren = true; | 239 relayoutChildren = true; |
| 238 | 240 |
| 239 LayoutUnit previousHeight = logicalHeight(); | 241 LayoutUnit previousHeight = logicalHeight(); |
| 240 setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight())
; | 242 setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight())
; |
| 241 | 243 |
| 242 { | 244 { |
| 243 LayoutStateMaintainer statePusher(*this, locationOffset()); | 245 LayoutStateMaintainer statePusher(*this, locationOffset()); |
| 244 | 246 |
| 245 m_numberOfInFlowChildrenOnFirstLine = -1; | 247 m_numberOfInFlowChildrenOnFirstLine = -1; |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 size_t seenInFlowPositionedChildren = 0; | 1105 size_t seenInFlowPositionedChildren = 0; |
| 1104 bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow(); | 1106 bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow(); |
| 1105 for (size_t i = 0; i < children.size(); ++i) { | 1107 for (size_t i = 0; i < children.size(); ++i) { |
| 1106 RenderBox* child = children[i]; | 1108 RenderBox* child = children[i]; |
| 1107 | 1109 |
| 1108 if (child->isOutOfFlowPositioned()) { | 1110 if (child->isOutOfFlowPositioned()) { |
| 1109 prepareChildForPositionedLayout(child, mainAxisOffset, crossAxisOffs
et, FlipForRowReverse); | 1111 prepareChildForPositionedLayout(child, mainAxisOffset, crossAxisOffs
et, FlipForRowReverse); |
| 1110 continue; | 1112 continue; |
| 1111 } | 1113 } |
| 1112 | 1114 |
| 1115 child->setMayNeedInvalidation(true); |
| 1116 |
| 1113 LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPadding
ExtentForChild(child); | 1117 LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPadding
ExtentForChild(child); |
| 1114 setLogicalOverrideSize(child, childPreferredSize); | 1118 setLogicalOverrideSize(child, childPreferredSize); |
| 1115 if (childPreferredSize != mainAxisExtentForChild(child)) { | 1119 if (childPreferredSize != mainAxisExtentForChild(child)) { |
| 1116 child->setChildNeedsLayout(MarkOnlyThis); | 1120 child->setChildNeedsLayout(MarkOnlyThis); |
| 1117 } else { | 1121 } else { |
| 1118 // To avoid double applying margin changes in updateAutoMarginsInCro
ssAxis, we reset the margins here. | 1122 // To avoid double applying margin changes in updateAutoMarginsInCro
ssAxis, we reset the margins here. |
| 1119 resetAutoMarginsAndLogicalTopInCrossAxis(child); | 1123 resetAutoMarginsAndLogicalTopInCrossAxis(child); |
| 1120 } | 1124 } |
| 1121 // We may have already forced relayout for orthogonal flowing children i
n preferredMainAxisContentExtentForChild. | 1125 // We may have already forced relayout for orthogonal flowing children i
n preferredMainAxisContentExtentForChild. |
| 1122 bool forceChildRelayout = relayoutChildren && !childPreferredMainAxisCon
tentExtentRequiresLayout(child, hasInfiniteLineLength); | 1126 bool forceChildRelayout = relayoutChildren && !childPreferredMainAxisCon
tentExtentRequiresLayout(child, hasInfiniteLineLength); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 ASSERT(child); | 1412 ASSERT(child); |
| 1409 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1413 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
| 1410 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1414 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
| 1411 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1415 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
| 1412 adjustAlignmentForChild(child, newOffset - originalOffset); | 1416 adjustAlignmentForChild(child, newOffset - originalOffset); |
| 1413 } | 1417 } |
| 1414 } | 1418 } |
| 1415 } | 1419 } |
| 1416 | 1420 |
| 1417 } | 1421 } |
| OLD | NEW |