Chromium Code Reviews

Unified Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 25687002: Add support for the column-fill property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 0de35fd03f46f325c0544306a83072050786a693..39d591aa1a2a6ea49f2cfa0289687668fdb56c43 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -176,6 +176,32 @@ template<> inline CSSPrimitiveValue::operator CSSReflectionDirection() const
return ReflectionBelow;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnFill columnFill)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_VALUE_ID;
+ switch (columnFill) {
+ case ColumnFillAuto:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case ColumnFillBalance:
+ m_value.valueID = CSSValueBalance;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator ColumnFill() const
+{
+ if (m_primitiveUnitType == CSS_VALUE_ID) {
+ if (m_value.valueID == CSSValueBalance)
+ return ColumnFillBalance;
+ if (m_value.valueID == CSSValueAuto)
+ return ColumnFillAuto;
+ }
+ ASSERT_NOT_REACHED();
+ return ColumnFillBalance;
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColumnSpan columnSpan)
: CSSValue(PrimitiveClass)
{

Powered by Google App Engine