Index: Source/core/rendering/style/RenderStyle.cpp |
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp |
index 93e907ac1076bd5079cab8f72a997bc605cb2064..568ab195c1d6a256b7a170899346daffd40aec32 100644 |
--- a/Source/core/rendering/style/RenderStyle.cpp |
+++ b/Source/core/rendering/style/RenderStyle.cpp |
@@ -197,13 +197,19 @@ StyleRecalcChange RenderStyle::stylePropagationDiff(const RenderStyle* oldStyle, |
return NoInherit; |
} |
-ItemPosition RenderStyle::resolveAlignment(const RenderStyle* parentStyle, const RenderStyle* childStyle) |
+ItemPosition RenderStyle::resolveAlignment(const RenderStyle* parentStyle, const RenderStyle* childStyle, ItemPosition resolvedAutoPositionForRenderer) |
{ |
- ItemPosition align = childStyle->alignSelf(); |
// The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto". |
- if (align == ItemPositionAuto) |
- align = (parentStyle->alignItems() == ItemPositionAuto) ? ItemPositionStretch : parentStyle->alignItems(); |
- return align; |
+ if (childStyle->alignSelf() == ItemPositionAuto) |
+ return (parentStyle->alignItems() == ItemPositionAuto) ? resolvedAutoPositionForRenderer : parentStyle->alignItems(); |
+ return childStyle->alignSelf(); |
+} |
+ |
+ItemPosition RenderStyle::resolveJustification(const RenderStyle* parentStyle, const RenderStyle* childStyle, ItemPosition resolvedAutoPositionForRenderer) |
+{ |
+ if (childStyle->justifySelf() == ItemPositionAuto) |
+ return (parentStyle->justifyItems() == ItemPositionAuto) ? resolvedAutoPositionForRenderer : parentStyle->justifyItems(); |
+ return childStyle->justifySelf(); |
} |
void RenderStyle::inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary isAtShadowBoundary) |