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

Unified Diff: Source/WebCore/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: 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
Index: Source/WebCore/rendering/style/GridPosition.h
diff --git a/Source/WebCore/rendering/style/GridPosition.h b/Source/WebCore/rendering/style/GridPosition.h
index 3f8fe974d30c0fe1d4d5551a67e39a93c07f393b..14749feabdddbe5a6ffae69838ed8b6c08937c22 100644
--- a/Source/WebCore/rendering/style/GridPosition.h
+++ b/Source/WebCore/rendering/style/GridPosition.h
@@ -35,7 +35,8 @@ namespace WebCore {
enum GridPositionType {
AutoPosition,
- IntegerPosition
+ IntegerPosition,
+ SpanPosition
};
class GridPosition {
@@ -50,6 +51,7 @@ public:
GridPositionType type() const { return m_type; }
bool isAuto() const { return m_type == AutoPosition; }
+ bool isInteger() const { return m_type == IntegerPosition; }
void setIntegerPosition(int position)
{
@@ -57,12 +59,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;

Powered by Google App Engine
This is Rietveld 408576698