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

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

Issue 2507383002: Changed ETextAlign to an enum class and renamed its members to keywords (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleAdjuster.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. 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 6 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 } 2019 }
2020 2020
2021 ASSERT_NOT_REACHED(); 2021 ASSERT_NOT_REACHED();
2022 return TableLayoutAuto; 2022 return TableLayoutAuto;
2023 } 2023 }
2024 2024
2025 template <> 2025 template <>
2026 inline CSSIdentifierValue::CSSIdentifierValue(ETextAlign e) 2026 inline CSSIdentifierValue::CSSIdentifierValue(ETextAlign e)
2027 : CSSValue(IdentifierClass) { 2027 : CSSValue(IdentifierClass) {
2028 switch (e) { 2028 switch (e) {
2029 case TASTART: 2029 case ETextAlign::Start:
2030 m_valueID = CSSValueStart; 2030 m_valueID = CSSValueStart;
2031 break; 2031 break;
2032 case TAEND: 2032 case ETextAlign::End:
2033 m_valueID = CSSValueEnd; 2033 m_valueID = CSSValueEnd;
2034 break; 2034 break;
2035 case LEFT: 2035 case ETextAlign::Left:
2036 m_valueID = CSSValueLeft; 2036 m_valueID = CSSValueLeft;
2037 break; 2037 break;
2038 case RIGHT: 2038 case ETextAlign::Right:
2039 m_valueID = CSSValueRight; 2039 m_valueID = CSSValueRight;
2040 break; 2040 break;
2041 case CENTER: 2041 case ETextAlign::Center:
2042 m_valueID = CSSValueCenter; 2042 m_valueID = CSSValueCenter;
2043 break; 2043 break;
2044 case JUSTIFY: 2044 case ETextAlign::Justify:
2045 m_valueID = CSSValueJustify; 2045 m_valueID = CSSValueJustify;
2046 break; 2046 break;
2047 case WEBKIT_LEFT: 2047 case ETextAlign::WebkitLeft:
2048 m_valueID = CSSValueWebkitLeft; 2048 m_valueID = CSSValueWebkitLeft;
2049 break; 2049 break;
2050 case WEBKIT_RIGHT: 2050 case ETextAlign::WebkitRight:
2051 m_valueID = CSSValueWebkitRight; 2051 m_valueID = CSSValueWebkitRight;
2052 break; 2052 break;
2053 case WEBKIT_CENTER: 2053 case ETextAlign::WebkitCenter:
2054 m_valueID = CSSValueWebkitCenter; 2054 m_valueID = CSSValueWebkitCenter;
2055 break; 2055 break;
2056 } 2056 }
2057 } 2057 }
2058 2058
2059 template <> 2059 template <>
2060 inline ETextAlign CSSIdentifierValue::convertTo() const { 2060 inline ETextAlign CSSIdentifierValue::convertTo() const {
2061 switch (m_valueID) { 2061 switch (m_valueID) {
2062 case CSSValueWebkitAuto: // Legacy -webkit-auto. Eqiuvalent to start. 2062 case CSSValueWebkitAuto: // Legacy -webkit-auto. Eqiuvalent to start.
2063 case CSSValueStart: 2063 case CSSValueStart:
2064 return TASTART; 2064 return ETextAlign::Start;
2065 case CSSValueEnd: 2065 case CSSValueEnd:
2066 return TAEND; 2066 return ETextAlign::End;
2067 case CSSValueInternalCenter: 2067 case CSSValueInternalCenter:
2068 return CENTER; 2068 return ETextAlign::Center;
2069 default: 2069 default:
2070 return static_cast<ETextAlign>(m_valueID - CSSValueLeft); 2070 return static_cast<ETextAlign>(m_valueID - CSSValueLeft);
2071 } 2071 }
2072 } 2072 }
2073 2073
2074 template <> 2074 template <>
2075 inline CSSIdentifierValue::CSSIdentifierValue(TextAlignLast e) 2075 inline CSSIdentifierValue::CSSIdentifierValue(TextAlignLast e)
2076 : CSSValue(IdentifierClass) { 2076 : CSSValue(IdentifierClass) {
2077 switch (e) { 2077 switch (e) {
2078 case TextAlignLastStart: 2078 case TextAlignLastStart:
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after
4663 default: 4663 default:
4664 break; 4664 break;
4665 } 4665 }
4666 ASSERT_NOT_REACHED(); 4666 ASSERT_NOT_REACHED();
4667 return ContainsNone; 4667 return ContainsNone;
4668 } 4668 }
4669 4669
4670 } // namespace blink 4670 } // namespace blink
4671 4671
4672 #endif 4672 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698