Index: third_party/WebKit/Source/core/css/CSSPrimitiveValue.h |
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h |
index d7f09dfddd207632a66e45771608e08c0c27ad14..c419a3c261ef3962cf8ed3b51097c0a7359ebaae 100644 |
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h |
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h |
@@ -38,6 +38,7 @@ namespace blink { |
class CSSBasicShape; |
class CSSCalcValue; |
class CSSToLengthConversionData; |
+class CSSVariableData; |
class Length; |
class RGBColor; |
class ComputedStyle; |
@@ -115,6 +116,7 @@ public: |
// inside a table cell. This quirk is specified in the HTML spec but our impl is different. |
// TODO: Remove this. crbug.com/443952 |
QuirkyEms, |
+ VariableReference, |
Timothy Loh
2015/09/30 02:09:27
I think we aren't adding any more random types to
|
}; |
enum LengthUnitType { |
@@ -190,6 +192,7 @@ public: |
bool isTime() const { return type() == UnitType::Seconds || type() == UnitType::Milliseconds; } |
bool isURI() const { return type() == UnitType::URI; } |
bool isCalculated() const { return type() == UnitType::Calc; } |
+ bool isVariableReference() const { return type() == UnitType::VariableReference; } |
bool isCalculatedPercentageWithNumber() const { return typeWithCalcResolved() == UnitType::CalcPercentageWithNumber; } |
bool isCalculatedPercentageWithLength() const { return typeWithCalcResolved() == UnitType::CalcPercentageWithLength; } |
static bool isDotsPerInch(UnitType type) { return type == UnitType::DotsPerInch; } |
@@ -256,6 +259,12 @@ public: |
CSSCalcValue* cssCalcValue() const { ASSERT(isCalculated()); return m_value.calc; } |
CSSPropertyID getPropertyID() const { ASSERT(isPropertyID()); return m_value.propertyID; } |
+ CSSVariableData* getVariableDataValue() const |
+ { |
+ ASSERT(type() == UnitType::VariableReference); |
+ return m_value.variableData; |
+ } |
+ |
CSSValueID getValueID() const { return type() == UnitType::ValueID ? m_value.valueID : CSSValueInvalid; } |
template<typename T> inline operator T() const; // Defined in CSSPrimitiveValueMappings.h |
@@ -303,6 +312,7 @@ private: |
void init(const Length&); |
void init(PassRefPtrWillBeRawPtr<CSSBasicShape>); |
void init(PassRefPtrWillBeRawPtr<CSSCalcValue>); |
+ void init(PassRefPtrWillBeRawPtr<CSSVariableData>); |
double computeLengthDouble(const CSSToLengthConversionData&) const; |
@@ -317,6 +327,7 @@ private: |
// FIXME: oilpan: Should be members, but no support for members in unions. Just trace the raw ptr for now. |
CSSBasicShape* shape; |
CSSCalcValue* calc; |
+ CSSVariableData* variableData; |
} m_value; |
}; |