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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int, BlockLayoutPass) | 159 void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int, BlockLayoutPass) |
160 { | 160 { |
161 ASSERT(needsLayout()); | 161 ASSERT(needsLayout()); |
162 | 162 |
163 if (!relayoutChildren && simplifiedLayout()) | 163 if (!relayoutChildren && simplifiedLayout()) |
164 return; | 164 return; |
165 | 165 |
166 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); | 166 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); |
167 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransf
orm() || hasReflection() || style()->isFlippedBlocksWritingMode()); | 167 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransf
orm() || hasReflection() || style()->isFlippedBlocksWritingMode()); |
168 | 168 |
| 169 if (inRenderFlowThread()) { |
| 170 // Regions changing widths can force us to relayout our children. |
| 171 if (logicalWidthChangedInRegions()) |
| 172 relayoutChildren = true; |
| 173 } |
| 174 computeInitialRegionRangeForBlock(); |
| 175 |
169 IntSize previousSize = size(); | 176 IntSize previousSize = size(); |
170 | 177 |
171 setLogicalHeight(0); | 178 setLogicalHeight(0); |
172 // We need to call both of these because we grab both crossAxisExtent and ma
inAxisExtent in layoutFlexItems. | 179 // We need to call both of these because we grab both crossAxisExtent and ma
inAxisExtent in layoutFlexItems. |
173 computeLogicalWidth(); | 180 computeLogicalWidth(); |
174 computeLogicalHeight(); | 181 computeLogicalHeight(); |
175 | 182 |
176 m_overflow.clear(); | 183 m_overflow.clear(); |
177 | 184 |
178 // For overflow:scroll blocks, ensure we have both scrollbars in place alway
s. | 185 // For overflow:scroll blocks, ensure we have both scrollbars in place alway
s. |
179 if (scrollsOverflow()) { | 186 if (scrollsOverflow()) { |
180 if (style()->overflowX() == OSCROLL) | 187 if (style()->overflowX() == OSCROLL) |
181 layer()->setHasHorizontalScrollbar(true); | 188 layer()->setHasHorizontalScrollbar(true); |
182 if (style()->overflowY() == OSCROLL) | 189 if (style()->overflowY() == OSCROLL) |
183 layer()->setHasVerticalScrollbar(true); | 190 layer()->setHasVerticalScrollbar(true); |
184 } | 191 } |
185 | 192 |
186 layoutFlexItems(relayoutChildren); | 193 layoutFlexItems(relayoutChildren); |
187 | 194 |
188 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); | 195 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); |
189 computeLogicalHeight(); | 196 computeLogicalHeight(); |
190 | 197 |
191 if (size() != previousSize) | 198 if (size() != previousSize) |
192 relayoutChildren = true; | 199 relayoutChildren = true; |
193 | 200 |
194 layoutPositionedObjects(relayoutChildren || isRoot()); | 201 layoutPositionedObjects(relayoutChildren || isRoot()); |
195 | 202 |
| 203 computeRegionRangeForBlock(); |
| 204 |
196 // FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflo
w than it needs to. | 205 // FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflo
w than it needs to. |
197 computeOverflow(oldClientAfterEdge); | 206 computeOverflow(oldClientAfterEdge); |
198 statePusher.pop(); | 207 statePusher.pop(); |
199 | 208 |
200 updateLayerTransform(); | 209 updateLayerTransform(); |
201 | 210 |
202 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | 211 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if |
203 // we overflow or not. | 212 // we overflow or not. |
204 if (hasOverflowClip()) | 213 if (hasOverflowClip()) |
205 layer()->updateScrollInfoAfterLayout(); | 214 layer()->updateScrollInfoAfterLayout(); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 case AlignBaseline: { | 806 case AlignBaseline: { |
798 LayoutUnit ascent = marginBoxAscent(child); | 807 LayoutUnit ascent = marginBoxAscent(child); |
799 adjustAlignmentForChild(child, maxAscent - ascent); | 808 adjustAlignmentForChild(child, maxAscent - ascent); |
800 break; | 809 break; |
801 } | 810 } |
802 } | 811 } |
803 } | 812 } |
804 } | 813 } |
805 | 814 |
806 } | 815 } |
OLD | NEW |