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

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

Issue 2913723002: Generate enum/getters/setters/mappings for text-orientation. (Closed)
Patch Set: Rebase Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CSSValueIDMappings_h 5 #ifndef CSSValueIDMappings_h
6 #define CSSValueIDMappings_h 6 #define CSSValueIDMappings_h
7 7
8 #include "core/CSSValueIDMappingsGenerated.h" 8 #include "core/CSSValueIDMappingsGenerated.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 25 matching lines...) Expand all
36 template <> 36 template <>
37 inline ETextAlign CssValueIDToPlatformEnum(CSSValueID v) { 37 inline ETextAlign CssValueIDToPlatformEnum(CSSValueID v) {
38 if (v == CSSValueWebkitAuto) // Legacy -webkit-auto. Eqiuvalent to start. 38 if (v == CSSValueWebkitAuto) // Legacy -webkit-auto. Eqiuvalent to start.
39 return ETextAlign::kStart; 39 return ETextAlign::kStart;
40 if (v == CSSValueInternalCenter) 40 if (v == CSSValueInternalCenter)
41 return ETextAlign::kCenter; 41 return ETextAlign::kCenter;
42 return detail::cssValueIDToPlatformEnumGenerated<ETextAlign>(v); 42 return detail::cssValueIDToPlatformEnumGenerated<ETextAlign>(v);
43 } 43 }
44 44
45 template <> 45 template <>
46 inline ETextOrientation CssValueIDToPlatformEnum(CSSValueID v) {
47 if (v == CSSValueSidewaysRight) // Legacy -webkit-auto. Eqiuvalent to start.
48 return ETextOrientation::kSideways;
49 if (v == CSSValueVerticalRight)
50 return ETextOrientation::kMixed;
51 return detail::cssValueIDToPlatformEnumGenerated<ETextOrientation>(v);
52 }
53
54 template <>
46 inline WritingMode CssValueIDToPlatformEnum(CSSValueID v) { 55 inline WritingMode CssValueIDToPlatformEnum(CSSValueID v) {
47 switch (v) { 56 switch (v) {
48 case CSSValueHorizontalTb: 57 case CSSValueHorizontalTb:
49 case CSSValueLr: 58 case CSSValueLr:
50 case CSSValueLrTb: 59 case CSSValueLrTb:
51 case CSSValueRl: 60 case CSSValueRl:
52 case CSSValueRlTb: 61 case CSSValueRlTb:
53 return WritingMode::kHorizontalTb; 62 return WritingMode::kHorizontalTb;
54 case CSSValueVerticalRl: 63 case CSSValueVerticalRl:
55 case CSSValueTb: 64 case CSSValueTb:
(...skipping 23 matching lines...) Expand all
79 if (v == CSSValueWebkitFlex) 88 if (v == CSSValueWebkitFlex)
80 return EDisplay::kFlex; 89 return EDisplay::kFlex;
81 if (v == CSSValueWebkitInlineFlex) 90 if (v == CSSValueWebkitInlineFlex)
82 return EDisplay::kInlineFlex; 91 return EDisplay::kInlineFlex;
83 return detail::cssValueIDToPlatformEnumGenerated<EDisplay>(v); 92 return detail::cssValueIDToPlatformEnumGenerated<EDisplay>(v);
84 } 93 }
85 94
86 } // namespace blink 95 } // namespace blink
87 96
88 #endif 97 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698