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

Side by Side Diff: sky/engine/core/css/CSSPrimitiveValueMappings.h

Issue 700703002: Remove more float machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 case CSSValueBottom: 778 case CSSValueBottom:
779 return CAPBOTTOM; 779 return CAPBOTTOM;
780 default: 780 default:
781 break; 781 break;
782 } 782 }
783 783
784 ASSERT_NOT_REACHED(); 784 ASSERT_NOT_REACHED();
785 return CAPTOP; 785 return CAPTOP;
786 } 786 }
787 787
788 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
789 : CSSValue(PrimitiveClass)
790 {
791 m_primitiveUnitType = CSS_VALUE_ID;
792 switch (e) {
793 case CNONE:
794 m_value.valueID = CSSValueNone;
795 break;
796 case CLEFT:
797 m_value.valueID = CSSValueLeft;
798 break;
799 case CRIGHT:
800 m_value.valueID = CSSValueRight;
801 break;
802 case CBOTH:
803 m_value.valueID = CSSValueBoth;
804 break;
805 }
806 }
807
808 template<> inline CSSPrimitiveValue::operator EClear() const
809 {
810 ASSERT(isValueID());
811 switch (m_value.valueID) {
812 case CSSValueNone:
813 return CNONE;
814 case CSSValueLeft:
815 return CLEFT;
816 case CSSValueRight:
817 return CRIGHT;
818 case CSSValueBoth:
819 return CBOTH;
820 default:
821 break;
822 }
823
824 ASSERT_NOT_REACHED();
825 return CNONE;
826 }
827
828 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e) 788 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
829 : CSSValue(PrimitiveClass) 789 : CSSValue(PrimitiveClass)
830 { 790 {
831 m_primitiveUnitType = CSS_VALUE_ID; 791 m_primitiveUnitType = CSS_VALUE_ID;
832 switch (e) { 792 switch (e) {
833 case CURSOR_AUTO: 793 case CURSOR_AUTO:
834 m_value.valueID = CSSValueAuto; 794 m_value.valueID = CSSValueAuto;
835 break; 795 break;
836 case CURSOR_CROSS: 796 case CURSOR_CROSS:
837 m_value.valueID = CSSValueCrosshair; 797 m_value.valueID = CSSValueCrosshair;
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 case CSSValueWrapReverse: 1148 case CSSValueWrapReverse:
1189 return FlexWrapReverse; 1149 return FlexWrapReverse;
1190 default: 1150 default:
1191 break; 1151 break;
1192 } 1152 }
1193 1153
1194 ASSERT_NOT_REACHED(); 1154 ASSERT_NOT_REACHED();
1195 return FlexNoWrap; 1155 return FlexNoWrap;
1196 } 1156 }
1197 1157
1198 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
1199 : CSSValue(PrimitiveClass)
1200 {
1201 m_primitiveUnitType = CSS_VALUE_ID;
1202 switch (e) {
1203 case NoFloat:
1204 m_value.valueID = CSSValueNone;
1205 break;
1206 case LeftFloat:
1207 m_value.valueID = CSSValueLeft;
1208 break;
1209 case RightFloat:
1210 m_value.valueID = CSSValueRight;
1211 break;
1212 }
1213 }
1214
1215 template<> inline CSSPrimitiveValue::operator EFloat() const
1216 {
1217 ASSERT(isValueID());
1218 switch (m_value.valueID) {
1219 case CSSValueLeft:
1220 return LeftFloat;
1221 case CSSValueRight:
1222 return RightFloat;
1223 case CSSValueNone:
1224 case CSSValueCenter: // Non-standard CSS value.
1225 return NoFloat;
1226 default:
1227 break;
1228 }
1229
1230 ASSERT_NOT_REACHED();
1231 return NoFloat;
1232 }
1233
1234 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineBreak e) 1158 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineBreak e)
1235 : CSSValue(PrimitiveClass) 1159 : CSSValue(PrimitiveClass)
1236 { 1160 {
1237 m_primitiveUnitType = CSS_VALUE_ID; 1161 m_primitiveUnitType = CSS_VALUE_ID;
1238 switch (e) { 1162 switch (e) {
1239 case LineBreakAuto: 1163 case LineBreakAuto:
1240 m_value.valueID = CSSValueAuto; 1164 m_value.valueID = CSSValueAuto;
1241 break; 1165 break;
1242 case LineBreakLoose: 1166 case LineBreakLoose:
1243 m_value.valueID = CSSValueLoose; 1167 m_value.valueID = CSSValueLoose;
(...skipping 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 default: 3672 default:
3749 break; 3673 break;
3750 } 3674 }
3751 ASSERT_NOT_REACHED(); 3675 ASSERT_NOT_REACHED();
3752 return ScrollBehaviorInstant; 3676 return ScrollBehaviorInstant;
3753 } 3677 }
3754 3678
3755 } 3679 }
3756 3680
3757 #endif 3681 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSComputedStyleDeclaration.cpp ('k') | sky/engine/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698