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

Unified Diff: Source/core/rendering/style/GridPosition.h

Issue 14715014: Add parsing for named grid lines (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing (fixed Elliott's comments) Created 7 years, 7 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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/GridPosition.h
diff --git a/Source/core/rendering/style/GridPosition.h b/Source/core/rendering/style/GridPosition.h
index a099c4fab0d587db1bc3955231007ddaa50dbdda..ae93e5d0b997acbfda4a0e1b9f083ded2dfdc313 100644
--- a/Source/core/rendering/style/GridPosition.h
+++ b/Source/core/rendering/style/GridPosition.h
@@ -31,11 +31,13 @@
#ifndef GridPosition_h
#define GridPosition_h
+#include "wtf/text/WTFString.h"
+
namespace WebCore {
enum GridPositionType {
AutoPosition,
- IntegerPosition,
+ ExplicitPosition, // [ <integer> || <string> ]
SpanPosition
};
@@ -51,13 +53,13 @@ public:
GridPositionType type() const { return m_type; }
bool isAuto() const { return m_type == AutoPosition; }
- bool isInteger() const { return m_type == IntegerPosition; }
bool isSpan() const { return m_type == SpanPosition; }
- void setIntegerPosition(int position)
+ void setExplicitPosition(int position, const String& namedGridLine)
{
- m_type = IntegerPosition;
+ m_type = ExplicitPosition;
m_integerPosition = position;
+ m_namedGridLine = namedGridLine;
}
// 'span' values cannot be negative, yet we reuse the <integer> position which can
@@ -71,10 +73,16 @@ public:
int integerPosition() const
{
- ASSERT(type() == IntegerPosition);
+ ASSERT(type() == ExplicitPosition);
return m_integerPosition;
}
+ String namedGridLine() const
+ {
+ ASSERT(type() == ExplicitPosition);
+ return m_namedGridLine;
+ }
+
int spanPosition() const
{
ASSERT(type() == SpanPosition);
@@ -93,6 +101,7 @@ public:
private:
GridPositionType m_type;
int m_integerPosition;
+ String m_namedGridLine;
};
} // namespace WebCore
« no previous file with comments | « Source/core/rendering/RenderGrid.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698