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

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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperty.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4967 matching lines...) Expand 10 before | Expand all | Expand 10 after
4978 return PaddingBox; 4978 return PaddingBox;
4979 case CSSValueContentBox: 4979 case CSSValueContentBox:
4980 return ContentBox; 4980 return ContentBox;
4981 default: 4981 default:
4982 break; 4982 break;
4983 } 4983 }
4984 ASSERT_NOT_REACHED(); 4984 ASSERT_NOT_REACHED();
4985 return ContentBox; 4985 return ContentBox;
4986 } 4986 }
4987 4987
4988 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelf justifySelf)
4989 : CSSValue(PrimitiveClass)
4990 {
4991 m_primitiveUnitType = CSS_VALUE_ID;
4992 switch (justifySelf) {
4993 case JustifySelfAuto:
4994 m_value.valueID = CSSValueAuto;
4995 break;
4996 case JustifySelfStretch:
4997 m_value.valueID = CSSValueStretch;
4998 break;
4999 case JustifySelfBaseline:
5000 m_value.valueID = CSSValueBaseline;
5001 break;
5002 case JustifySelfCenter:
5003 m_value.valueID = CSSValueCenter;
5004 break;
5005 case JustifySelfStart:
5006 m_value.valueID = CSSValueStart;
5007 break;
5008 case JustifySelfEnd:
5009 m_value.valueID = CSSValueEnd;
5010 break;
5011 case JustifySelfSelfStart:
5012 m_value.valueID = CSSValueSelfStart;
5013 break;
5014 case JustifySelfSelfEnd:
5015 m_value.valueID = CSSValueSelfEnd;
5016 break;
5017 case JustifySelfFlexStart:
5018 m_value.valueID = CSSValueFlexStart;
5019 break;
5020 case JustifySelfFlexEnd:
5021 m_value.valueID = CSSValueFlexEnd;
5022 break;
5023 case JustifySelfLeft:
5024 m_value.valueID = CSSValueLeft;
5025 break;
5026 case JustifySelfRight:
5027 m_value.valueID = CSSValueRight;
5028 break;
5029 }
5030 }
5031
5032 template<> inline CSSPrimitiveValue::operator JustifySelf() const
5033 {
5034 switch (m_value.valueID) {
5035 case CSSValueAuto:
5036 return JustifySelfAuto;
5037 case CSSValueStretch:
5038 return JustifySelfStretch;
5039 case CSSValueBaseline:
5040 return JustifySelfBaseline;
5041 case CSSValueCenter:
5042 return JustifySelfCenter;
5043 case CSSValueStart:
5044 return JustifySelfStart;
5045 case CSSValueEnd:
5046 return JustifySelfEnd;
5047 case CSSValueSelfStart:
5048 return JustifySelfSelfStart;
5049 case CSSValueSelfEnd:
5050 return JustifySelfSelfEnd;
5051 case CSSValueFlexStart:
5052 return JustifySelfFlexStart;
5053 case CSSValueFlexEnd:
5054 return JustifySelfFlexEnd;
5055 case CSSValueLeft:
5056 return JustifySelfLeft;
5057 case CSSValueRight:
5058 return JustifySelfRight;
5059 default:
5060 break;
5061 }
5062 ASSERT_NOT_REACHED();
5063 return JustifySelfAuto;
5064 }
5065
5066 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelfOverflowAlignm ent overflowAlignment)
5067 : CSSValue(PrimitiveClass)
5068 {
5069 m_primitiveUnitType = CSS_VALUE_ID;
5070 switch (overflowAlignment) {
5071 case JustifySelfOverflowAlignmentDefault:
5072 m_value.valueID = CSSValueDefault;
5073 break;
5074 case JustifySelfOverflowAlignmentTrue:
5075 m_value.valueID = CSSValueTrue;
5076 break;
5077 case JustifySelfOverflowAlignmentSafe:
5078 m_value.valueID = CSSValueSafe;
5079 break;
5080 }
5081 }
5082
5083 template<> inline CSSPrimitiveValue::operator JustifySelfOverflowAlignment() con st
5084 {
5085 switch (m_value.valueID) {
5086 case CSSValueTrue:
5087 return JustifySelfOverflowAlignmentTrue;
5088 case CSSValueSafe:
5089 return JustifySelfOverflowAlignmentSafe;
5090 default:
5091 break;
5092 }
5093 ASSERT_NOT_REACHED();
5094 return JustifySelfOverflowAlignmentTrue;
5095 }
5096
4988 } 5097 }
4989 5098
4990 #endif 5099 #endif
OLDNEW
« 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