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

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

Issue 17090005: [CSS Grid Layout] Implement 'justify-self' parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed a bug in parseColor uncovered by the patch Created 6 years, 11 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/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperty.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 5d2e5a7add138e24d7adcdf15e9bbee325a6aa7c..d2baffb93d63b1b6a6f1bb63ffe928f614fc6723 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -4985,6 +4985,115 @@ template<> inline CSSPrimitiveValue::operator LayoutBox() const
return ContentBox;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelf justifySelf)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_VALUE_ID;
+ switch (justifySelf) {
+ case JustifySelfAuto:
+ m_value.valueID = CSSValueAuto;
+ break;
+ case JustifySelfStretch:
+ m_value.valueID = CSSValueStretch;
+ break;
+ case JustifySelfBaseline:
+ m_value.valueID = CSSValueBaseline;
+ break;
+ case JustifySelfCenter:
+ m_value.valueID = CSSValueCenter;
+ break;
+ case JustifySelfStart:
+ m_value.valueID = CSSValueStart;
+ break;
+ case JustifySelfEnd:
+ m_value.valueID = CSSValueEnd;
+ break;
+ case JustifySelfSelfStart:
+ m_value.valueID = CSSValueSelfStart;
+ break;
+ case JustifySelfSelfEnd:
+ m_value.valueID = CSSValueSelfEnd;
+ break;
+ case JustifySelfFlexStart:
+ m_value.valueID = CSSValueFlexStart;
+ break;
+ case JustifySelfFlexEnd:
+ m_value.valueID = CSSValueFlexEnd;
+ break;
+ case JustifySelfLeft:
+ m_value.valueID = CSSValueLeft;
+ break;
+ case JustifySelfRight:
+ m_value.valueID = CSSValueRight;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator JustifySelf() const
+{
+ switch (m_value.valueID) {
+ case CSSValueAuto:
+ return JustifySelfAuto;
+ case CSSValueStretch:
+ return JustifySelfStretch;
+ case CSSValueBaseline:
+ return JustifySelfBaseline;
+ case CSSValueCenter:
+ return JustifySelfCenter;
+ case CSSValueStart:
+ return JustifySelfStart;
+ case CSSValueEnd:
+ return JustifySelfEnd;
+ case CSSValueSelfStart:
+ return JustifySelfSelfStart;
+ case CSSValueSelfEnd:
+ return JustifySelfSelfEnd;
+ case CSSValueFlexStart:
+ return JustifySelfFlexStart;
+ case CSSValueFlexEnd:
+ return JustifySelfFlexEnd;
+ case CSSValueLeft:
+ return JustifySelfLeft;
+ case CSSValueRight:
+ return JustifySelfRight;
+ default:
+ break;
+ }
+ ASSERT_NOT_REACHED();
+ return JustifySelfAuto;
+}
+
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelfOverflowAlignment overflowAlignment)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_VALUE_ID;
+ switch (overflowAlignment) {
+ case JustifySelfOverflowAlignmentDefault:
+ m_value.valueID = CSSValueDefault;
+ break;
+ case JustifySelfOverflowAlignmentTrue:
+ m_value.valueID = CSSValueTrue;
+ break;
+ case JustifySelfOverflowAlignmentSafe:
+ m_value.valueID = CSSValueSafe;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator JustifySelfOverflowAlignment() const
+{
+ switch (m_value.valueID) {
+ case CSSValueTrue:
+ return JustifySelfOverflowAlignmentTrue;
+ case CSSValueSafe:
+ return JustifySelfOverflowAlignmentSafe;
+ default:
+ break;
+ }
+ ASSERT_NOT_REACHED();
+ return JustifySelfOverflowAlignmentTrue;
+}
+
}
#endif
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698