| Index: Source/core/layout/LayoutBox.cpp
|
| diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
|
| index 78cc863c00f7c60c6398c8324003374d91bb8047..b7199a19948f93dca28ad8c3654a21fdd91382fb 100644
|
| --- a/Source/core/layout/LayoutBox.cpp
|
| +++ b/Source/core/layout/LayoutBox.cpp
|
| @@ -252,6 +252,7 @@ void LayoutBox::styleDidChange(StyleDifference diff, const ComputedStyle* oldSty
|
| }
|
| updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
|
| updateGridPositionAfterStyleChange(oldStyle);
|
| + updateAlignmentAfterStyleChange(oldStyle);
|
|
|
| if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlaceholder())
|
| placeholder->updateMarginProperties();
|
| @@ -299,6 +300,23 @@ void LayoutBox::updateGridPositionAfterStyleChange(const ComputedStyle* oldStyle
|
| toLayoutGrid(parent())->dirtyGrid();
|
| }
|
|
|
| +void LayoutBox::updateAlignmentAfterStyleChange(const ComputedStyle* oldStyle)
|
| +{
|
| + if (!oldStyle)
|
| + return;
|
| +
|
| + // When container's justify-items value changes and the new value containes the 'legacy'
|
| + // keyword, it will affect children's justify-item 'auto' value resolution.
|
| + if (oldStyle->justifyItemsPositionType() != styleRef().justifyItemsPositionType()
|
| + || (styleRef().justifyItemsPositionType() == LegacyPosition && oldStyle->justifyItemsPosition() != styleRef().justifyItemsPosition())) {
|
| + for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
|
| + if ((styleRef().justifyItemsPositionType() == LegacyPosition) && (child->styleRef().justifyItemsPosition() == ItemPositionAuto))
|
| + child->mutableStyleRef().setJustifyItemsPosition(styleRef().justifyItemsPosition());
|
| + child->setNeedsLayout(LayoutInvalidationReason::GridChanged);
|
| + }
|
| + }
|
| +}
|
| +
|
| void LayoutBox::updateFromStyle()
|
| {
|
| LayoutBoxModelObject::updateFromStyle();
|
| @@ -2140,7 +2158,7 @@ static bool columnFlexItemHasStretchAlignment(const LayoutObject* flexitem)
|
| ASSERT(parent->style()->isColumnFlexDirection());
|
| if (flexitem->style()->marginStart().isAuto() || flexitem->style()->marginEnd().isAuto())
|
| return false;
|
| - return flexitem->style()->alignSelfPosition() == ItemPositionStretch || (flexitem->style()->alignSelfPosition() == ItemPositionAuto && parent->style()->alignItemsPosition() == ItemPositionStretch);
|
| + return ComputedStyle::resolvedAlignSelfPosition(parent->styleRef(), flexitem->styleRef(), ItemPositionStretch) == ItemPositionStretch;
|
| }
|
|
|
| static bool isStretchingColumnFlexItem(const LayoutObject* flexitem)
|
|
|