Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| index 7c5a3ec0fa7ad15135b60b2e62a3698710bb155f..dede7ace30f3fe8dc89e5398eee9dbbfb61b9638 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| @@ -1224,8 +1224,18 @@ void LayoutBlock::layoutPositionedObjects(bool relayoutChildren, PositionedLayou |
| positionedObject->layoutIfNeeded(); |
| + LayoutObject* parent = positionedObject->parent(); |
| + bool relaidOut = false; |
|
eae
2016/04/25 02:37:28
How about needsLayout or layoutChanged instead?
cbiesinger
2016/04/26 18:21:56
Done, though I'm not certain I like this one eithe
|
| + if (parent->isFlexibleBox() && toLayoutFlexibleBox(parent)->setStaticPositionForPositionedLayout(*positionedObject)) { |
| + // The static position of an abspos child of a flexbox depends on its size (for example, |
| + // they can be centered). So we may have to reposition the item after layout. |
| + // TODO(cbiesinger): We could probably avoid a layout here and just reposition? |
| + positionedObject->forceChildLayout(); |
| + relaidOut = true; |
| + } |
| + |
| // Lay out again if our estimate was wrong. |
| - if (needsBlockDirectionLocationSetBeforeLayout && logicalTopEstimate != logicalTopForChild(*positionedObject)) |
| + if (!relaidOut && needsBlockDirectionLocationSetBeforeLayout && logicalTopEstimate != logicalTopForChild(*positionedObject)) |
| positionedObject->forceChildLayout(); |
| } |
| } |