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

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

Issue 13992003: Add support for parsing <grid-line> that includes a 'span' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed the change to match the specification Created 7 years, 8 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 1c89b54192c3ea955fa73186f154c8d170120702..376a096cbe62e37face4b91c7924ce2ec5e5777a 100644
--- a/Source/core/rendering/style/GridPosition.h
+++ b/Source/core/rendering/style/GridPosition.h
@@ -35,7 +35,8 @@ namespace WebCore {
enum GridPositionType {
AutoPosition,
- IntegerPosition
+ IntegerPosition,
+ SpanPosition
};
class GridPosition {
@@ -50,6 +51,8 @@ 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)
{
@@ -57,12 +60,27 @@ public:
m_integerPosition = position;
}
+ // 'span' values cannot be negative, yet we reuse the <integer> position which can
+ // be. This means that we have to convert the span position to an integer, losing
+ // some precision here. It shouldn't be an issue in practice though.
+ void setSpanPosition(int position)
+ {
+ m_type = SpanPosition;
+ m_integerPosition = position;
+ }
+
int integerPosition() const
{
ASSERT(type() == IntegerPosition);
return m_integerPosition;
}
+ int spanPosition() const
+ {
+ ASSERT(type() == SpanPosition);
+ return m_integerPosition;
+ }
+
bool operator==(const GridPosition& other) const
{
return m_type == other.m_type && m_integerPosition == other.m_integerPosition;
« 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