Index: sky/engine/core/css/resolver/StyleAdjuster.cpp |
diff --git a/sky/engine/core/css/resolver/StyleAdjuster.cpp b/sky/engine/core/css/resolver/StyleAdjuster.cpp |
index 8e0110d583738df5834ac64f11c084abe72b28c2..8788d7450e1745760596606d9a4eeb15fdc14ad0 100644 |
--- a/sky/engine/core/css/resolver/StyleAdjuster.cpp |
+++ b/sky/engine/core/css/resolver/StyleAdjuster.cpp |
@@ -184,53 +184,19 @@ void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty |
void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyle& parentStyle) |
{ |
- bool isFlex = style.isDisplayFlexibleBox(); |
- 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. |
- // - 'start' for everything else. |
if (style.justifyItems() == ItemPositionAuto) { |
- if (parentStyle.justifyItemsPositionType() == LegacyPosition) { |
- style.setJustifyItems(parentStyle.justifyItems()); |
- style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType()); |
- } else if (isFlex) { |
- style.setJustifyItems(ItemPositionStretch); |
- } |
+ style.setJustifyItems(parentStyle.justifyItems()); |
+ style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType()); |
} |
- // 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()); |
- } |
+ style.setJustifySelf(parentStyle.justifyItems()); |
eseidel
2015/04/06 23:29:19
Should this be squashed into a single if now? Thes
ojan
2015/04/06 23:41:49
They're reading/writing different values. justifyI
|
+ style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment()); |
} |
- // The 'auto' keyword computes to: |
- // - 'stretch' for flex containers, |
- // - 'start' for everything else. |
- if (style.alignItems() == ItemPositionAuto) { |
- if (isFlex) |
- style.setAlignItems(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.alignSelf() == ItemPositionAuto) { |
- if (absolutePositioned) { |
- style.setAlignSelf(ItemPositionStretch); |
- } else { |
- style.setAlignSelf(parentStyle.alignItems()); |
- style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment()); |
- } |
+ style.setAlignSelf(parentStyle.alignItems()); |
+ style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment()); |
eseidel
2015/04/06 23:29:19
This one too? are these ifs even needed?
|
} |
} |