Index: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
index 8206cec2423b731be21597f5019e5d2dc235a9f9..ca698047e9e0887fade16146a40459a9142dcb4d 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
@@ -262,38 +262,20 @@ void StyleAdjuster::adjustStyleForFirstLetter(ComputedStyle& style) |
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' |
+ // 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. |
+ // Otherwise, 'auto' computes to 'normal'. |
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()); |
+ style.setJustifyItemsPosition(ItemPositionNormal); |
} |
- // 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 the computed value of justify-items on the parent (minus |
+ // any legacy keywords), or 'normal' if the box has no parent. |
+ if (style.justifySelfPosition() == ItemPositionAuto) |
+ style.setJustifySelf(parentStyle.justifyItems()); |
} |
void StyleAdjuster::adjustStyleForHTMLElement(ComputedStyle& style, const ComputedStyle& parentStyle, HTMLElement& element) |