| 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 03966af22e6565dc301b18b4c9285380783cf56e..375d4a4277ba5116d997db3195fd9481a189da6f 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 layoutChanged = false;
|
| + 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();
|
| + layoutChanged = true;
|
| + }
|
| +
|
| // Lay out again if our estimate was wrong.
|
| - if (needsBlockDirectionLocationSetBeforeLayout && logicalTopEstimate != logicalTopForChild(*positionedObject))
|
| + if (!layoutChanged && needsBlockDirectionLocationSetBeforeLayout && logicalTopEstimate != logicalTopForChild(*positionedObject))
|
| positionedObject->forceChildLayout();
|
| }
|
| }
|
|
|