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

Side by Side Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 131773002: Broaden justify-self's parsing name (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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) 4988 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ItemPosition itemPosition )
4989 : CSSValue(PrimitiveClass) 4989 : CSSValue(PrimitiveClass)
4990 { 4990 {
4991 m_primitiveUnitType = CSS_VALUE_ID; 4991 m_primitiveUnitType = CSS_VALUE_ID;
4992 switch (justifySelf) { 4992 switch (itemPosition) {
4993 case JustifySelfAuto: 4993 case ItemPositionAuto:
4994 m_value.valueID = CSSValueAuto; 4994 m_value.valueID = CSSValueAuto;
4995 break; 4995 break;
4996 case JustifySelfStretch: 4996 case ItemPositionStretch:
4997 m_value.valueID = CSSValueStretch; 4997 m_value.valueID = CSSValueStretch;
4998 break; 4998 break;
4999 case JustifySelfBaseline: 4999 case ItemPositionBaseline:
5000 m_value.valueID = CSSValueBaseline; 5000 m_value.valueID = CSSValueBaseline;
5001 break; 5001 break;
5002 case JustifySelfCenter: 5002 case ItemPositionCenter:
5003 m_value.valueID = CSSValueCenter; 5003 m_value.valueID = CSSValueCenter;
5004 break; 5004 break;
5005 case JustifySelfStart: 5005 case ItemPositionStart:
5006 m_value.valueID = CSSValueStart; 5006 m_value.valueID = CSSValueStart;
5007 break; 5007 break;
5008 case JustifySelfEnd: 5008 case ItemPositionEnd:
5009 m_value.valueID = CSSValueEnd; 5009 m_value.valueID = CSSValueEnd;
5010 break; 5010 break;
5011 case JustifySelfSelfStart: 5011 case ItemPositionSelfStart:
5012 m_value.valueID = CSSValueSelfStart; 5012 m_value.valueID = CSSValueSelfStart;
5013 break; 5013 break;
5014 case JustifySelfSelfEnd: 5014 case ItemPositionSelfEnd:
5015 m_value.valueID = CSSValueSelfEnd; 5015 m_value.valueID = CSSValueSelfEnd;
5016 break; 5016 break;
5017 case JustifySelfFlexStart: 5017 case ItemPositionFlexStart:
5018 m_value.valueID = CSSValueFlexStart; 5018 m_value.valueID = CSSValueFlexStart;
5019 break; 5019 break;
5020 case JustifySelfFlexEnd: 5020 case ItemPositionFlexEnd:
5021 m_value.valueID = CSSValueFlexEnd; 5021 m_value.valueID = CSSValueFlexEnd;
5022 break; 5022 break;
5023 case JustifySelfLeft: 5023 case ItemPositionLeft:
5024 m_value.valueID = CSSValueLeft; 5024 m_value.valueID = CSSValueLeft;
5025 break; 5025 break;
5026 case JustifySelfRight: 5026 case ItemPositionRight:
5027 m_value.valueID = CSSValueRight; 5027 m_value.valueID = CSSValueRight;
5028 break; 5028 break;
5029 } 5029 }
5030 } 5030 }
5031 5031
5032 template<> inline CSSPrimitiveValue::operator JustifySelf() const 5032 template<> inline CSSPrimitiveValue::operator ItemPosition() const
5033 { 5033 {
5034 switch (m_value.valueID) { 5034 switch (m_value.valueID) {
5035 case CSSValueAuto: 5035 case CSSValueAuto:
5036 return JustifySelfAuto; 5036 return ItemPositionAuto;
5037 case CSSValueStretch: 5037 case CSSValueStretch:
5038 return JustifySelfStretch; 5038 return ItemPositionStretch;
5039 case CSSValueBaseline: 5039 case CSSValueBaseline:
5040 return JustifySelfBaseline; 5040 return ItemPositionBaseline;
5041 case CSSValueCenter: 5041 case CSSValueCenter:
5042 return JustifySelfCenter; 5042 return ItemPositionCenter;
5043 case CSSValueStart: 5043 case CSSValueStart:
5044 return JustifySelfStart; 5044 return ItemPositionStart;
5045 case CSSValueEnd: 5045 case CSSValueEnd:
5046 return JustifySelfEnd; 5046 return ItemPositionEnd;
5047 case CSSValueSelfStart: 5047 case CSSValueSelfStart:
5048 return JustifySelfSelfStart; 5048 return ItemPositionSelfStart;
5049 case CSSValueSelfEnd: 5049 case CSSValueSelfEnd:
5050 return JustifySelfSelfEnd; 5050 return ItemPositionSelfEnd;
5051 case CSSValueFlexStart: 5051 case CSSValueFlexStart:
5052 return JustifySelfFlexStart; 5052 return ItemPositionFlexStart;
5053 case CSSValueFlexEnd: 5053 case CSSValueFlexEnd:
5054 return JustifySelfFlexEnd; 5054 return ItemPositionFlexEnd;
5055 case CSSValueLeft: 5055 case CSSValueLeft:
5056 return JustifySelfLeft; 5056 return ItemPositionLeft;
5057 case CSSValueRight: 5057 case CSSValueRight:
5058 return JustifySelfRight; 5058 return ItemPositionRight;
5059 default: 5059 default:
5060 break; 5060 break;
5061 } 5061 }
5062 ASSERT_NOT_REACHED(); 5062 ASSERT_NOT_REACHED();
5063 return JustifySelfAuto; 5063 return ItemPositionAuto;
5064 } 5064 }
5065 5065
5066 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(JustifySelfOverflowAlignm ent overflowAlignment) 5066 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(OverflowAlignment overflo wAlignment)
5067 : CSSValue(PrimitiveClass) 5067 : CSSValue(PrimitiveClass)
5068 { 5068 {
5069 m_primitiveUnitType = CSS_VALUE_ID; 5069 m_primitiveUnitType = CSS_VALUE_ID;
5070 switch (overflowAlignment) { 5070 switch (overflowAlignment) {
5071 case JustifySelfOverflowAlignmentDefault: 5071 case OverflowAlignmentDefault:
5072 m_value.valueID = CSSValueDefault; 5072 m_value.valueID = CSSValueDefault;
5073 break; 5073 break;
5074 case JustifySelfOverflowAlignmentTrue: 5074 case OverflowAlignmentTrue:
5075 m_value.valueID = CSSValueTrue; 5075 m_value.valueID = CSSValueTrue;
5076 break; 5076 break;
5077 case JustifySelfOverflowAlignmentSafe: 5077 case OverflowAlignmentSafe:
5078 m_value.valueID = CSSValueSafe; 5078 m_value.valueID = CSSValueSafe;
5079 break; 5079 break;
5080 } 5080 }
5081 } 5081 }
5082 5082
5083 template<> inline CSSPrimitiveValue::operator JustifySelfOverflowAlignment() con st 5083 template<> inline CSSPrimitiveValue::operator OverflowAlignment() const
5084 { 5084 {
5085 switch (m_value.valueID) { 5085 switch (m_value.valueID) {
5086 case CSSValueTrue: 5086 case CSSValueTrue:
5087 return JustifySelfOverflowAlignmentTrue; 5087 return OverflowAlignmentTrue;
5088 case CSSValueSafe: 5088 case CSSValueSafe:
5089 return JustifySelfOverflowAlignmentSafe; 5089 return OverflowAlignmentSafe;
5090 default: 5090 default:
5091 break; 5091 break;
5092 } 5092 }
5093 ASSERT_NOT_REACHED(); 5093 ASSERT_NOT_REACHED();
5094 return JustifySelfOverflowAlignmentTrue; 5094 return OverflowAlignmentTrue;
5095 } 5095 }
5096 5096
5097 } 5097 }
5098 5098
5099 #endif 5099 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/parser/BisonCSSParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698