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

Unified Diff: Source/core/rendering/RenderGrid.cpp

Issue 17601010: [CSS Grid Layout] Rename grid placement properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: missing webposed/ changes Created 7 years, 6 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/RenderGrid.h ('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 006e722989a445c43948923b26e63175eab065d9..29f9c2cc9d1a95471008886f5133d690797ba967 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -440,7 +440,7 @@ size_t RenderGrid::explicitGridRowCount() const
size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const
{
- return (side == StartSide || side == EndSide) ? explicitGridColumnCount() : explicitGridRowCount();
+ return (side == ColumnStartSide || side == ColumnEndSide) ? explicitGridColumnCount() : explicitGridRowCount();
}
size_t RenderGrid::maximumIndexInDirection(TrackSizingDirection direction) const
@@ -823,10 +823,10 @@ RenderGrid::GridSpan RenderGrid::resolveGridPositionsFromAutoPlacementPosition(c
PassOwnPtr<RenderGrid::GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, TrackSizingDirection direction) const
{
- const GridPosition& initialPosition = (direction == ForColumns) ? gridItem->style()->gridStart() : gridItem->style()->gridBefore();
- const GridPositionSide initialPositionSide = (direction == ForColumns) ? StartSide : BeforeSide;
- const GridPosition& finalPosition = (direction == ForColumns) ? gridItem->style()->gridEnd() : gridItem->style()->gridAfter();
- const GridPositionSide finalPositionSide = (direction == ForColumns) ? EndSide : AfterSide;
+ const GridPosition& initialPosition = (direction == ForColumns) ? gridItem->style()->gridColumnStart() : gridItem->style()->gridRowStart();
+ const GridPositionSide initialPositionSide = (direction == ForColumns) ? ColumnStartSide : RowStartSide;
+ const GridPosition& finalPosition = (direction == ForColumns) ? gridItem->style()->gridColumnEnd() : gridItem->style()->gridRowEnd();
+ const GridPositionSide finalPositionSide = (direction == ForColumns) ? ColumnEndSide : RowEndSide;
// We should NEVER see both spans as they should have been handled during style resolve.
ASSERT(!initialPosition.isSpan() || !finalPosition.isSpan());
@@ -864,7 +864,7 @@ PassOwnPtr<RenderGrid::GridSpan> RenderGrid::resolveGridPositionsFromStyle(const
static size_t adjustGridPositionForSide(size_t resolvedPosition, GridPositionSide side)
{
// An item finishing on the N-th line belongs to the N-1-th cell.
- if (side == EndSide || side == AfterSide)
+ if (side == ColumnEndSide || side == RowEndSide)
return resolvedPosition ? resolvedPosition - 1 : 0;
return resolvedPosition;
@@ -874,7 +874,7 @@ size_t RenderGrid::resolveNamedGridLinePositionFromStyle(const GridPosition& pos
{
ASSERT(!position.namedGridLine().isNull());
- const NamedGridLinesMap& gridLinesNames = (side == StartSide || side == EndSide) ? style()->namedGridColumnLines() : style()->namedGridRowLines();
+ const NamedGridLinesMap& gridLinesNames = (side == ColumnStartSide || side == ColumnEndSide) ? style()->namedGridColumnLines() : style()->namedGridRowLines();
NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGridLine());
if (it == gridLinesNames.end()) {
if (position.isPositive())
@@ -938,7 +938,7 @@ PassOwnPtr<RenderGrid::GridSpan> RenderGrid::resolveGridPositionAgainstOppositeP
// 'span 1' is contained inside a single grid track regardless of the direction.
// That's why the CSS span value is one more than the offset we apply.
size_t positionOffset = position.spanPosition() - 1;
- if (side == StartSide || side == BeforeSide) {
+ if (side == ColumnStartSide || side == RowStartSide) {
size_t initialResolvedPosition = std::max<int>(0, resolvedOppositePosition - positionOffset);
return GridSpan::create(initialResolvedPosition, resolvedOppositePosition);
}
« no previous file with comments | « Source/core/rendering/RenderGrid.h ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698