OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 void RenderGrid::layoutBlock(bool relayoutChildren) | 331 void RenderGrid::layoutBlock(bool relayoutChildren) |
332 { | 332 { |
333 ASSERT(needsLayout()); | 333 ASSERT(needsLayout()); |
334 | 334 |
335 if (!relayoutChildren && simplifiedLayout()) | 335 if (!relayoutChildren && simplifiedLayout()) |
336 return; | 336 return; |
337 | 337 |
338 // FIXME: Much of this method is boiler plate that matches RenderBox::layout
Block and Render*FlexibleBox::layoutBlock. | 338 // FIXME: Much of this method is boiler plate that matches RenderBox::layout
Block and Render*FlexibleBox::layoutBlock. |
339 // It would be nice to refactor some of the duplicate code. | 339 // It would be nice to refactor some of the duplicate code. |
340 LayoutState state(*this, locationOffset()); | 340 { |
| 341 // LayoutState needs this deliberate scope to pop before updating scroll
information (which |
| 342 // may trigger relayout). |
| 343 LayoutState state(*this, locationOffset()); |
341 | 344 |
342 LayoutSize previousSize = size(); | 345 LayoutSize previousSize = size(); |
343 | 346 |
344 setLogicalHeight(0); | 347 setLogicalHeight(0); |
345 updateLogicalWidth(); | 348 updateLogicalWidth(); |
346 | 349 |
347 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); | 350 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); |
348 | 351 |
349 layoutGridItems(); | 352 layoutGridItems(); |
350 | 353 |
351 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); | 354 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); |
352 updateLogicalHeight(); | 355 updateLogicalHeight(); |
353 | 356 |
354 if (size() != previousSize) | 357 if (size() != previousSize) |
355 relayoutChildren = true; | 358 relayoutChildren = true; |
356 | 359 |
357 layoutPositionedObjects(relayoutChildren || isDocumentElement()); | 360 layoutPositionedObjects(relayoutChildren || isDocumentElement()); |
358 | 361 |
359 computeOverflow(oldClientAfterEdge); | 362 computeOverflow(oldClientAfterEdge); |
| 363 } |
360 | 364 |
361 updateLayerTransformAfterLayout(); | 365 updateLayerTransformAfterLayout(); |
362 | 366 |
363 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | 367 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if |
364 // we overflow or not. | 368 // we overflow or not. |
365 if (hasOverflowClip()) | 369 if (hasOverflowClip()) |
366 layer()->scrollableArea()->updateAfterLayout(); | 370 layer()->scrollableArea()->updateAfterLayout(); |
367 | 371 |
368 clearNeedsLayout(); | 372 clearNeedsLayout(); |
369 } | 373 } |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 if (isOutOfFlowPositioned()) | 1517 if (isOutOfFlowPositioned()) |
1514 return "RenderGrid (positioned)"; | 1518 return "RenderGrid (positioned)"; |
1515 if (isAnonymous()) | 1519 if (isAnonymous()) |
1516 return "RenderGrid (generated)"; | 1520 return "RenderGrid (generated)"; |
1517 if (isRelPositioned()) | 1521 if (isRelPositioned()) |
1518 return "RenderGrid (relative positioned)"; | 1522 return "RenderGrid (relative positioned)"; |
1519 return "RenderGrid"; | 1523 return "RenderGrid"; |
1520 } | 1524 } |
1521 | 1525 |
1522 } // namespace blink | 1526 } // namespace blink |
OLD | NEW |