Index: Source/core/css/resolver/StyleAdjuster.cpp |
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp |
index 01b0857a3e2e95ba27a5e8c6f42dbe2f07299594..40acdfd1c83685df2a601b710af257491bcd1ea9 100644 |
--- a/Source/core/css/resolver/StyleAdjuster.cpp |
+++ b/Source/core/css/resolver/StyleAdjuster.cpp |
@@ -270,42 +270,28 @@ void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl |
if (parentStyle.justifyItemsPositionType() == LegacyPosition) { |
style.setJustifyItems(parentStyle.justifyItems()); |
style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType()); |
- } else if (isFlexOrGrid) { |
- style.setJustifyItems(ItemPositionStretch); |
+ } else { |
+ style.setJustifyItems(isFlexOrGrid ? ItemPositionStretch : ItemPositionStart); |
} |
} |
// 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.justifySelf() == ItemPositionAuto) { |
- if (absolutePositioned) { |
- style.setJustifySelf(ItemPositionStretch); |
- } else { |
- style.setJustifySelf(parentStyle.justifyItems()); |
- style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment()); |
- } |
- } |
+ // any 'legacy' keywords) on all other boxes (to be resolved during the layout). |
+ if ((style.justifySelf() == ItemPositionAuto) && absolutePositioned) |
+ style.setJustifySelf(ItemPositionStretch); |
// The 'auto' keyword computes to: |
// - 'stretch' for flex containers and grid containers, |
// - 'start' for everything else. |
- if (style.alignItems() == ItemPositionAuto) { |
- if (isFlexOrGrid) |
- style.setAlignItems(ItemPositionStretch); |
- } |
+ if (style.alignItems() == ItemPositionAuto) |
+ style.setAlignItems(isFlexOrGrid ? ItemPositionStretch : ItemPositionStart); |
// 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.alignSelf() == ItemPositionAuto) { |
- if (absolutePositioned) { |
- style.setAlignSelf(ItemPositionStretch); |
- } else { |
- style.setAlignSelf(parentStyle.alignItems()); |
- style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment()); |
- } |
- } |
+ // any 'legacy' keywords) on all other boxes (to be resolved during the layout). |
+ if ((style.alignSelf() == ItemPositionAuto) && absolutePositioned) |
+ style.setAlignSelf(ItemPositionStretch); |
} |
void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* parentStyle, Element& element) |