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

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

Issue 1500433003: [css-grid] Get rid of GridResolvedPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New version fixing compilation issues Created 5 years 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 add326d5be4e593fadf9069bce728081c3f0cdd4..6d4a77e6ac695658d08d2e835b85cdc2ce4d79bd 100644
--- a/third_party/WebKit/Source/core/style/GridResolvedPosition.h
+++ b/third_party/WebKit/Source/core/style/GridResolvedPosition.h
@@ -26,73 +26,12 @@ enum GridTrackSizingDirection {
ForRows
};
-// 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.
+// This is a utility class with all the code related to grid items positions resolution.
+// TODO(rego): Rename class to GridPositionsResolver.
class GridResolvedPosition {
DISALLOW_NEW();
public:
- GridResolvedPosition(size_t position)
- : m_integerPosition(position)
- {
- }
-
- GridResolvedPosition& operator*()
- {
- return *this;
- }
-
- GridResolvedPosition& operator++()
- {
- m_integerPosition++;
- return *this;
- }
-
- bool operator==(const GridResolvedPosition& other) const
- {
- return m_integerPosition == other.m_integerPosition;
- }
-
- bool operator!=(const GridResolvedPosition& other) const
- {
- return m_integerPosition != other.m_integerPosition;
- }
-
- bool operator<(const GridResolvedPosition& other) const
- {
- return m_integerPosition < other.m_integerPosition;
- }
-
- bool operator>(const GridResolvedPosition& other) const
- {
- return m_integerPosition > other.m_integerPosition;
- }
-
- bool operator<=(const GridResolvedPosition& other) const
- {
- return m_integerPosition <= other.m_integerPosition;
- }
-
- bool operator>=(const GridResolvedPosition& other) const
- {
- return m_integerPosition >= other.m_integerPosition;
- }
-
- size_t toInt() const
- {
- return m_integerPosition;
- }
-
- GridResolvedPosition next() const
- {
- 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&);
@@ -101,12 +40,9 @@ public:
static GridPositionSide initialPositionSide(GridTrackSizingDirection);
static GridPositionSide finalPositionSide(GridTrackSizingDirection);
- static GridSpan resolveGridPositionsFromAutoPlacementPosition(const ComputedStyle&, const LayoutBox&, GridTrackSizingDirection, const GridResolvedPosition&);
+ static GridSpan resolveGridPositionsFromAutoPlacementPosition(const ComputedStyle&, const LayoutBox&, GridTrackSizingDirection, size_t resolvedInitialPosition);
static GridSpan resolveGridPositionsFromStyle(const ComputedStyle&, const LayoutBox&, GridTrackSizingDirection);
-private:
-
- size_t m_integerPosition;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698