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

Unified Diff: third_party/WebKit/Source/core/style/GridResolvedPosition.h

Issue 1451883002: [css-grid] Store lines instead of tracks in GridResolvedPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ASSERT on the tests Created 5 years, 1 month 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: third_party/WebKit/Source/core/style/GridResolvedPosition.h
diff --git a/third_party/WebKit/Source/core/style/GridResolvedPosition.h b/third_party/WebKit/Source/core/style/GridResolvedPosition.h
index 184d312ccdbe60f2a31f8dec2b3a2933f63f14c0..4ac11e70dcb3918d2610412d7ab89548c94fe420 100644
--- a/third_party/WebKit/Source/core/style/GridResolvedPosition.h
+++ b/third_party/WebKit/Source/core/style/GridResolvedPosition.h
@@ -26,24 +26,11 @@ enum GridTrackSizingDirection {
ForRows
};
-// This class represents an index into one of the dimensions of the grid array.
+// This class represents a line index into one of the dimensions of the grid array.
// Wraps a size_t integer just for the purpose of knowing what we manipulate in the grid code.
class GridResolvedPosition {
DISALLOW_NEW();
public:
- static GridResolvedPosition adjustGridPositionForAfterEndSide(size_t resolvedPosition)
- {
- return resolvedPosition ? GridResolvedPosition(resolvedPosition - 1) : GridResolvedPosition(0);
- }
-
- static GridResolvedPosition adjustGridPositionForSide(size_t resolvedPosition, GridPositionSide side)
- {
- // An item finishing on the N-th line belongs to the N-1-th cell.
- if (side == ColumnEndSide || side == RowEndSide)
- return adjustGridPositionForAfterEndSide(resolvedPosition);
-
- return GridResolvedPosition(resolvedPosition);
- }
static bool isValidNamedLineOrArea(const String& lineName, const ComputedStyle&, GridPositionSide);
static GridPositionSide initialPositionSide(GridTrackSizingDirection);
@@ -61,14 +48,6 @@ public:
{
}
- GridResolvedPosition(const GridPosition& position, GridPositionSide side)
- {
- ASSERT(position.integerPosition());
- size_t integerPosition = position.integerPosition() - 1;
-
- m_integerPosition = adjustGridPositionForSide(integerPosition, side).toInt();
- }
-
GridResolvedPosition& operator*()
{
return *this;
@@ -120,6 +99,11 @@ public:
return GridResolvedPosition(m_integerPosition + 1);
}
+ GridResolvedPosition prev() const
+ {
+ return GridResolvedPosition(m_integerPosition > 0 ? m_integerPosition - 1 : 0);
+ }
+
static size_t explicitGridColumnCount(const ComputedStyle&);
static size_t explicitGridRowCount(const ComputedStyle&);
« no previous file with comments | « third_party/WebKit/Source/core/style/GridCoordinate.h ('k') | third_party/WebKit/Source/core/style/GridResolvedPosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698