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

Side by Side 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: Scrubbed and rebaselined patch Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 4939 matching lines...) Expand 10 before | Expand all | Expand 10 after
4950 case CSSValueScript: 4950 case CSSValueScript:
4951 return TouchActionDelayScript; 4951 return TouchActionDelayScript;
4952 default: 4952 default:
4953 break; 4953 break;
4954 } 4954 }
4955 4955
4956 ASSERT_NOT_REACHED(); 4956 ASSERT_NOT_REACHED();
4957 return TouchActionDelayNone; 4957 return TouchActionDelayNone;
4958 } 4958 }
4959 4959
4960 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelf justifySelf)
4961 : CSSValue(PrimitiveClass)
4962 {
4963 m_primitiveUnitType = CSS_VALUE_ID;
4964 switch (justifySelf) {
4965 case JustifySelfAuto:
4966 m_value.valueID = CSSValueAuto;
4967 break;
4968 case JustifySelfStretch:
4969 m_value.valueID = CSSValueStretch;
4970 break;
4971 case JustifySelfBaseline:
4972 m_value.valueID = CSSValueBaseline;
4973 break;
4974 case JustifySelfCenter:
4975 m_value.valueID = CSSValueCenter;
4976 break;
4977 case JustifySelfStart:
4978 m_value.valueID = CSSValueStart;
4979 break;
4980 case JustifySelfEnd:
4981 m_value.valueID = CSSValueEnd;
4982 break;
4983 case JustifySelfSelfStart:
4984 m_value.valueID = CSSValueSelfStart;
4985 break;
4986 case JustifySelfSelfEnd:
4987 m_value.valueID = CSSValueSelfEnd;
4988 break;
4989 case JustifySelfFlexStart:
4990 m_value.valueID = CSSValueFlexStart;
4991 break;
4992 case JustifySelfFlexEnd:
4993 m_value.valueID = CSSValueFlexEnd;
4994 break;
4995 case JustifySelfLeft:
4996 m_value.valueID = CSSValueLeft;
4997 break;
4998 case JustifySelfRight:
4999 m_value.valueID = CSSValueRight;
5000 break;
5001 }
5002 }
5003
5004 template<> inline CSSPrimitiveValue::operator JustifySelf() const
5005 {
5006 switch (m_value.valueID) {
5007 case CSSValueAuto:
5008 return JustifySelfAuto;
5009 case CSSValueStretch:
5010 return JustifySelfStretch;
5011 case CSSValueBaseline:
5012 return JustifySelfBaseline;
5013 case CSSValueCenter:
5014 return JustifySelfCenter;
5015 case CSSValueStart:
5016 return JustifySelfStart;
5017 case CSSValueEnd:
5018 return JustifySelfEnd;
5019 case CSSValueSelfStart:
5020 return JustifySelfSelfStart;
5021 case CSSValueSelfEnd:
5022 return JustifySelfSelfEnd;
5023 case CSSValueFlexStart:
5024 return JustifySelfFlexStart;
5025 case CSSValueFlexEnd:
5026 return JustifySelfFlexEnd;
5027 case CSSValueLeft:
5028 return JustifySelfLeft;
5029 case CSSValueRight:
5030 return JustifySelfRight;
5031 default:
5032 break;
5033 }
5034 ASSERT_NOT_REACHED();
5035 return JustifySelfAuto;
5036 }
5037
5038 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelfOverflowAlignm ent overflowAlignment)
5039 : CSSValue(PrimitiveClass)
5040 {
5041 m_primitiveUnitType = CSS_VALUE_ID;
5042 switch (overflowAlignment) {
5043 case JustifySelfOverflowAlignmentDefault:
5044 m_value.valueID = CSSValueDefault;
5045 break;
5046 case JustifySelfOverflowAlignmentTrue:
5047 m_value.valueID = CSSValueTrue;
5048 break;
5049 case JustifySelfOverflowAlignmentSafe:
5050 m_value.valueID = CSSValueSafe;
5051 break;
5052 }
5053 }
5054
5055 template<> inline CSSPrimitiveValue::operator JustifySelfOverflowAlignment() con st
5056 {
5057 switch (m_value.valueID) {
5058 case CSSValueTrue:
5059 return JustifySelfOverflowAlignmentTrue;
5060 case CSSValueSafe:
5061 return JustifySelfOverflowAlignmentSafe;
5062 default:
5063 break;
5064 }
5065 ASSERT_NOT_REACHED();
5066 return JustifySelfOverflowAlignmentTrue;
5067 }
4960 } 5068 }
4961 5069
4962 #endif 5070 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698