| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 SubtreeLayoutScope layoutScope(*this); | 76 SubtreeLayoutScope layoutScope(*this); |
| 77 | 77 |
| 78 layoutBlockFlow(relayoutChildren, layoutScope); | 78 layoutBlockFlow(relayoutChildren, layoutScope); |
| 79 | 79 |
| 80 updateLayerTransformAfterLayout(); | 80 updateLayerTransformAfterLayout(); |
| 81 | 81 |
| 82 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | 82 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if |
| 83 // we overflow or not. | 83 // we overflow or not. |
| 84 updateScrollInfoAfterLayout(); | 84 updateScrollInfoAfterLayout(); |
| 85 | 85 |
| 86 if (m_paintInvalidationLogicalTop != m_paintInvalidationLogicalBottom) | |
| 87 setShouldInvalidateOverflowForPaint(true); | |
| 88 | |
| 89 clearNeedsLayout(); | 86 clearNeedsLayout(); |
| 90 } | 87 } |
| 91 | 88 |
| 92 inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, SubtreeLayou
tScope& layoutScope) | 89 inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, SubtreeLayou
tScope& layoutScope) |
| 93 { | 90 { |
| 94 LayoutUnit oldLeft = logicalLeft(); | 91 LayoutUnit oldLeft = logicalLeft(); |
| 95 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); | 92 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); |
| 96 relayoutChildren |= logicalWidthChanged; | 93 relayoutChildren |= logicalWidthChanged; |
| 97 | 94 |
| 98 LayoutState state(*this, locationOffset(), logicalWidthChanged); | 95 LayoutState state(*this, locationOffset(), logicalWidthChanged); |
| 99 | 96 |
| 100 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); | 97 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); |
| 101 LayoutUnit afterEdge = borderAfter() + paddingAfter(); | 98 LayoutUnit afterEdge = borderAfter() + paddingAfter(); |
| 102 LayoutUnit previousHeight = logicalHeight(); | 99 LayoutUnit previousHeight = logicalHeight(); |
| 103 setLogicalHeight(beforeEdge); | 100 setLogicalHeight(beforeEdge); |
| 104 | 101 |
| 105 m_paintInvalidationLogicalTop = 0; | 102 layoutChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); |
| 106 m_paintInvalidationLogicalBottom = 0; | |
| 107 | |
| 108 layoutChildren(relayoutChildren, layoutScope, m_paintInvalidationLogicalTop,
m_paintInvalidationLogicalBottom, beforeEdge, afterEdge); | |
| 109 | 103 |
| 110 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); | 104 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); |
| 111 | 105 |
| 112 updateLogicalHeight(); | 106 updateLogicalHeight(); |
| 113 | 107 |
| 114 if (previousHeight != logicalHeight()) | 108 if (previousHeight != logicalHeight()) |
| 115 relayoutChildren = true; | 109 relayoutChildren = true; |
| 116 | 110 |
| 117 layoutPositionedObjects(relayoutChildren || isDocumentElement(), oldLeft !=
logicalLeft() ? ForcedLayoutAfterContainingBlockMoved : DefaultLayout); | 111 layoutPositionedObjects(relayoutChildren || isDocumentElement(), oldLeft !=
logicalLeft() ? ForcedLayoutAfterContainingBlockMoved : DefaultLayout); |
| 118 | 112 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 139 void RenderBlockFlow::layoutBlockChild(RenderBox* child) | 133 void RenderBlockFlow::layoutBlockChild(RenderBox* child) |
| 140 { | 134 { |
| 141 child->computeAndSetBlockDirectionMargins(this); | 135 child->computeAndSetBlockDirectionMargins(this); |
| 142 LayoutUnit marginBefore = marginBeforeForChild(child); | 136 LayoutUnit marginBefore = marginBeforeForChild(child); |
| 143 child->setY(logicalHeight() + marginBefore); | 137 child->setY(logicalHeight() + marginBefore); |
| 144 child->layoutIfNeeded(); | 138 child->layoutIfNeeded(); |
| 145 determineLogicalLeftPositionForChild(child); | 139 determineLogicalLeftPositionForChild(child); |
| 146 setLogicalHeight(logicalHeight() + marginBefore + logicalHeightForChild(chil
d) + marginAfterForChild(child)); | 140 setLogicalHeight(logicalHeight() + marginBefore + logicalHeightForChild(chil
d) + marginAfterForChild(child)); |
| 147 } | 141 } |
| 148 | 142 |
| 149 void RenderBlockFlow::layoutChildren(bool relayoutChildren, SubtreeLayoutScope&
layoutScope, LayoutUnit& paintInvalidationLogicalTop, LayoutUnit& paintInvalidat
ionLogicalBottom, LayoutUnit beforeEdge, LayoutUnit afterEdge) | 143 void RenderBlockFlow::layoutChildren(bool relayoutChildren, SubtreeLayoutScope&
layoutScope, LayoutUnit beforeEdge, LayoutUnit afterEdge) |
| 150 { | 144 { |
| 151 dirtyForLayoutFromPercentageHeightDescendants(layoutScope); | 145 dirtyForLayoutFromPercentageHeightDescendants(layoutScope); |
| 152 | 146 |
| 153 RenderBox* next = firstChildBox(); | 147 RenderBox* next = firstChildBox(); |
| 154 RenderBox* lastNormalFlowChild = 0; | 148 RenderBox* lastNormalFlowChild = 0; |
| 155 | 149 |
| 156 while (next) { | 150 while (next) { |
| 157 RenderBox* child = next; | 151 RenderBox* child = next; |
| 158 next = child->nextSiblingBox(); | 152 next = child->nextSiblingBox(); |
| 159 | 153 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 float logicalLeft = logicalLeftOffsetForLine(false).toFloat(); | 359 float logicalLeft = logicalLeftOffsetForLine(false).toFloat(); |
| 366 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft
; | 360 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft
; |
| 367 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 361 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
| 368 | 362 |
| 369 if (!style()->isLeftToRightDirection()) | 363 if (!style()->isLeftToRightDirection()) |
| 370 return logicalWidth() - logicalLeft; | 364 return logicalWidth() - logicalLeft; |
| 371 return logicalLeft; | 365 return logicalLeft; |
| 372 } | 366 } |
| 373 | 367 |
| 374 } // namespace blink | 368 } // namespace blink |
| OLD | NEW |