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

Unified Diff: Source/core/rendering/RenderGrid.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/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index e7daaecd24e539d34fa4095dad4fb805159dccc8..98a11bd637f3b63c31252d4806ea749c79b4eeb0 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "core/rendering/RenderGrid.h"
+#include "core/css/resolver/StyleAdjuster.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/TextAutosizer.h"
@@ -1284,20 +1285,10 @@ LayoutUnit RenderGrid::centeredRowPositionForChild(const RenderBox* child) const
return startOfRow + std::max<LayoutUnit>(0, endOfRow - startOfRow - child->logicalHeight()) / 2;
}
-// FIXME: We should move this logic to the StyleAdjuster or the StyleBuilder.
-static ItemPosition 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();
- return align;
-}
-
LayoutUnit RenderGrid::rowPositionForChild(const RenderBox* child) const
{
bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizontalWritingMode();
- ItemPosition alignSelf = resolveAlignment(style(), child->style());
+ ItemPosition alignSelf = StyleAdjuster::resolveAlignment(style(), child->style());
esprehn 2014/09/09 10:10:51 This is backwards, the StyleAdjuster should call s
Sunil Ratnu 2014/09/09 10:33:08 Thanks esprehn for review. Maybe not in StyleAdjus
switch (alignSelf) {
case ItemPositionSelfStart:
« Source/core/css/resolver/StyleAdjuster.cpp ('K') | « Source/core/rendering/RenderFlexibleBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698