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

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

Issue 22215002: Allow grid positions to be named grid areas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 b72cce0bec1ede37ff534bcfe0dfef483b2b0142..256f4163dbbcccdc33ca4a6278369f7ed5477b15 100644
--- a/Source/core/rendering/style/GridPosition.h
+++ b/Source/core/rendering/style/GridPosition.h
@@ -38,7 +38,8 @@ namespace WebCore {
enum GridPositionType {
AutoPosition,
ExplicitPosition, // [ <integer> || <string> ]
- SpanPosition
+ SpanPosition, // span && [ <integer> || <string> ]
+ NamedGridAreaPosition // <ident>
};
class GridPosition {
@@ -54,6 +55,7 @@ public:
GridPositionType type() const { return m_type; }
bool isAuto() const { return m_type == AutoPosition; }
bool isSpan() const { return m_type == SpanPosition; }
+ bool isNamedGridArea() const { return m_type == NamedGridAreaPosition; }
void setExplicitPosition(int position, const String& namedGridLine)
{
@@ -72,6 +74,12 @@ public:
m_namedGridLine = namedGridLine;
}
+ void setNamedGridArea(const String& namedGridArea)
+ {
+ m_type = NamedGridAreaPosition;
+ m_namedGridLine = namedGridArea;
+ }
+
int integerPosition() const
{
ASSERT(type() == ExplicitPosition);
@@ -80,7 +88,7 @@ public:
String namedGridLine() const
{
- ASSERT(type() == ExplicitPosition || type() == SpanPosition);
+ ASSERT(type() == ExplicitPosition || type() == SpanPosition || type() == NamedGridAreaPosition);
return m_namedGridLine;
}
« 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