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

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: Rebase 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
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index 6d602a8f788a0c6178be0c5b2bc22e8c41b269f8..9b6c8714e334716774ababff561cfd578426ad82 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -31,6 +31,7 @@
#include "core/rendering/RenderView.h"
#include "core/rendering/TextAutosizer.h"
#include "core/rendering/style/GridCoordinate.h"
+#include "core/rendering/style/RenderStyle.h"
#include "platform/LengthFunctions.h"
namespace blink {
@@ -1291,20 +1292,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 = RenderStyle::resolveAlignment(style(), child.style());
switch (alignSelf) {
case ItemPositionSelfStart:
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698