| Index: Source/core/css/resolver/StyleAdjuster.cpp
|
| diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
|
| index ddc486e2911935341e95b48dedfddcfd04cb115a..5421b2b5c4f381eab803b789a74c33c4c8e78bdc 100644
|
| --- a/Source/core/css/resolver/StyleAdjuster.cpp
|
| +++ b/Source/core/css/resolver/StyleAdjuster.cpp
|
| @@ -243,7 +243,11 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
|
| if (isSVGTextElement(*e))
|
| style.clearMultiCol();
|
| }
|
| - adjustStyleForAlignment(style, parentStyle);
|
| +
|
| + // If the inherited value of justify-items includes the legacy keyword, 'auto'
|
| + // computes to the the inherited value.
|
| + if (parentStyle.justifyItemsPositionType() == LegacyPosition && style.justifyItemsPosition() == ItemPositionAuto)
|
| + style.setJustifyItemsPosition(parentStyle.justifyItemsPosition());
|
| }
|
|
|
| void StyleAdjuster::adjustStyleForFirstLetter(ComputedStyle& style)
|
| @@ -258,78 +262,6 @@ void StyleAdjuster::adjustStyleForFirstLetter(ComputedStyle& style)
|
| style.setPosition(StaticPosition);
|
| }
|
|
|
| -void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style, const ComputedStyle& parentStyle)
|
| -{
|
| - bool isFlexOrGrid = style.isDisplayFlexibleOrGridBox();
|
| - bool absolutePositioned = style.position() == AbsolutePosition;
|
| -
|
| - // If the inherited value of justify-items includes the legacy keyword, 'auto'
|
| - // computes to the the inherited value.
|
| - // Otherwise, auto computes to:
|
| - // - 'stretch' for flex containers and grid containers.
|
| - // - 'start' for everything else.
|
| - if (style.justifyItemsPosition() == ItemPositionAuto) {
|
| - if (parentStyle.justifyItemsPositionType() == LegacyPosition)
|
| - style.setJustifyItems(parentStyle.justifyItems());
|
| - else if (isFlexOrGrid)
|
| - style.setJustifyItemsPosition(ItemPositionStretch);
|
| - }
|
| -
|
| - // The 'auto' keyword computes to 'stretch' on absolutely-positioned elements,
|
| - // and to the computed value of justify-items on the parent (minus
|
| - // any legacy keywords) on all other boxes.
|
| - if (style.justifySelfPosition() == ItemPositionAuto) {
|
| - if (absolutePositioned)
|
| - style.setJustifySelfPosition(ItemPositionStretch);
|
| - else
|
| - style.setJustifySelf(parentStyle.justifyItems());
|
| - }
|
| -
|
| - // The 'auto' keyword computes to:
|
| - // - 'stretch' for flex containers and grid containers,
|
| - // - 'start' for everything else.
|
| - if (style.alignItemsPosition() == ItemPositionAuto) {
|
| - if (isFlexOrGrid)
|
| - style.setAlignItemsPosition(ItemPositionStretch);
|
| - }
|
| -
|
| - // The 'auto' keyword computes to 'stretch' on absolutely-positioned elements,
|
| - // and to the computed value of align-items on the parent (minus
|
| - // any 'legacy' keywords) on all other boxes.
|
| - if (style.alignSelfPosition() == ItemPositionAuto) {
|
| - if (absolutePositioned)
|
| - style.setAlignSelfPosition(ItemPositionStretch);
|
| - else
|
| - style.setAlignSelf(parentStyle.alignItems());
|
| - }
|
| -
|
| - // Block Containers: For table cells, the behavior of the 'auto' depends on the computed
|
| - // value of 'vertical-align', otherwise behaves as 'start'.
|
| - // Flex Containers: 'auto' computes to 'flex-start'.
|
| - // Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like 'start'.
|
| - if ((style.justifyContentPosition() == ContentPositionAuto) && (style.justifyContentDistribution() == ContentDistributionDefault)) {
|
| - if (style.isDisplayFlexibleOrGridBox()) {
|
| - if (style.isDisplayFlexibleBox())
|
| - style.setJustifyContentPosition(ContentPositionFlexStart);
|
| - else
|
| - style.setJustifyContentPosition(ContentPositionStart);
|
| - }
|
| - }
|
| -
|
| - // Block Containers: For table cells, the behavior of the 'auto' depends on the computed
|
| - // value of 'vertical-align', otherwise behaves as 'start'.
|
| - // Flex Containers: 'auto' computes to 'stretch'.
|
| - // Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like 'start'.
|
| - if (style.alignContentPosition() == ContentPositionAuto && style.alignContentDistribution() == ContentDistributionDefault) {
|
| - if (style.isDisplayFlexibleOrGridBox()) {
|
| - if (style.isDisplayFlexibleBox())
|
| - style.setAlignContentDistribution(ContentDistributionStretch);
|
| - else
|
| - style.setAlignContentPosition(ContentPositionStart);
|
| - }
|
| - }
|
| -}
|
| -
|
| void StyleAdjuster::adjustStyleForHTMLElement(ComputedStyle& style, const ComputedStyle& parentStyle, HTMLElement& element)
|
| {
|
| // <div> and <span> are the most common elements on the web, we skip all the work for them.
|
|
|