Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 547673002: Move resolveAlignment logic to RenderStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index dc278e60be6e74766c7a3126440e13ee641804c2..591f2cd3ac1ae78c7eedd9daac072cce1289a789 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -152,6 +152,15 @@ static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style)
return false;
}
+ItemPosition StyleAdjuster::resolveAlignment(const RenderStyle* parentStyle, const RenderStyle* childStyle)
+{
+ 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();
esprehn 2014/09/09 10:10:51 This is not style adjuster's job, it's not a place
+ return align;
+}
+
void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentStyle, Element *e, const CachedUAStyle* cachedUAStyle)
{
ASSERT(parentStyle);

Powered by Google App Engine
This is Rietveld 408576698