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

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

Issue 2366263002: Changed ECaptionSide to an enum class and renamed its members to keywords (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutTable.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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 957
958 ASSERT_NOT_REACHED(); 958 ASSERT_NOT_REACHED();
959 return HORIZONTAL; 959 return HORIZONTAL;
960 } 960 }
961 961
962 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e) 962 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
963 : CSSValue(PrimitiveClass) 963 : CSSValue(PrimitiveClass)
964 { 964 {
965 init(UnitType::ValueID); 965 init(UnitType::ValueID);
966 switch (e) { 966 switch (e) {
967 case CaptionSideLeft: 967 case ECaptionSide::Left:
968 m_value.valueID = CSSValueLeft; 968 m_value.valueID = CSSValueLeft;
969 break; 969 break;
970 case CaptionSideRight: 970 case ECaptionSide::Right:
971 m_value.valueID = CSSValueRight; 971 m_value.valueID = CSSValueRight;
972 break; 972 break;
973 case CaptionSideTop: 973 case ECaptionSide::Top:
974 m_value.valueID = CSSValueTop; 974 m_value.valueID = CSSValueTop;
975 break; 975 break;
976 case CaptionSideBottom: 976 case ECaptionSide::Bottom:
977 m_value.valueID = CSSValueBottom; 977 m_value.valueID = CSSValueBottom;
978 break; 978 break;
979 } 979 }
980 } 980 }
981 981
982 template<> inline ECaptionSide CSSPrimitiveValue::convertTo() const 982 template<> inline ECaptionSide CSSPrimitiveValue::convertTo() const
983 { 983 {
984 ASSERT(isValueID()); 984 ASSERT(isValueID());
985 switch (m_value.valueID) { 985 switch (m_value.valueID) {
986 case CSSValueLeft: 986 case CSSValueLeft:
987 return CaptionSideLeft; 987 return ECaptionSide::Left;
988 case CSSValueRight: 988 case CSSValueRight:
989 return CaptionSideRight; 989 return ECaptionSide::Right;
990 case CSSValueTop: 990 case CSSValueTop:
991 return CaptionSideTop; 991 return ECaptionSide::Top;
992 case CSSValueBottom: 992 case CSSValueBottom:
993 return CaptionSideBottom; 993 return ECaptionSide::Bottom;
994 default: 994 default:
995 break; 995 break;
996 } 996 }
997 997
998 ASSERT_NOT_REACHED(); 998 ASSERT_NOT_REACHED();
999 return CaptionSideTop; 999 return ECaptionSide::Top;
1000 } 1000 }
1001 1001
1002 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e) 1002 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
1003 : CSSValue(PrimitiveClass) 1003 : CSSValue(PrimitiveClass)
1004 { 1004 {
1005 init(UnitType::ValueID); 1005 init(UnitType::ValueID);
1006 switch (e) { 1006 switch (e) {
1007 case ClearNone: 1007 case ClearNone:
1008 m_value.valueID = CSSValueNone; 1008 m_value.valueID = CSSValueNone;
1009 break; 1009 break;
(...skipping 3707 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 default: 4717 default:
4718 break; 4718 break;
4719 } 4719 }
4720 ASSERT_NOT_REACHED(); 4720 ASSERT_NOT_REACHED();
4721 return ContainsNone; 4721 return ContainsNone;
4722 } 4722 }
4723 4723
4724 } // namespace blink 4724 } // namespace blink
4725 4725
4726 #endif 4726 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698