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

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

Issue 2896723003: Generate enum/getters/setters/mappings for speak. (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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('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 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 return kGeometricPrecision; 2114 return kGeometricPrecision;
2115 default: 2115 default:
2116 break; 2116 break;
2117 } 2117 }
2118 2118
2119 NOTREACHED(); 2119 NOTREACHED();
2120 return kAutoTextRendering; 2120 return kAutoTextRendering;
2121 } 2121 }
2122 2122
2123 template <> 2123 template <>
2124 inline CSSIdentifierValue::CSSIdentifierValue(ESpeak e)
2125 : CSSValue(kIdentifierClass) {
2126 switch (e) {
2127 case ESpeak::kNone:
2128 value_id_ = CSSValueNone;
2129 break;
2130 case ESpeak::kNormal:
2131 value_id_ = CSSValueNormal;
2132 break;
2133 case ESpeak::kSpellOut:
2134 value_id_ = CSSValueSpellOut;
2135 break;
2136 case ESpeak::kDigits:
2137 value_id_ = CSSValueDigits;
2138 break;
2139 case ESpeak::kLiteralPunctuation:
2140 value_id_ = CSSValueLiteralPunctuation;
2141 break;
2142 case ESpeak::kNoPunctuation:
2143 value_id_ = CSSValueNoPunctuation;
2144 break;
2145 }
2146 }
2147
2148 template <>
2149 inline EOrder CSSIdentifierValue::ConvertTo() const { 2124 inline EOrder CSSIdentifierValue::ConvertTo() const {
2150 switch (value_id_) { 2125 switch (value_id_) {
2151 case CSSValueLogical: 2126 case CSSValueLogical:
2152 return EOrder::kLogical; 2127 return EOrder::kLogical;
2153 case CSSValueVisual: 2128 case CSSValueVisual:
2154 return EOrder::kVisual; 2129 return EOrder::kVisual;
2155 default: 2130 default:
2156 break; 2131 break;
2157 } 2132 }
2158 2133
2159 NOTREACHED(); 2134 NOTREACHED();
2160 return EOrder::kLogical; 2135 return EOrder::kLogical;
2161 } 2136 }
2162 2137
2163 template <> 2138 template <>
2164 inline CSSIdentifierValue::CSSIdentifierValue(EOrder e) 2139 inline CSSIdentifierValue::CSSIdentifierValue(EOrder e)
2165 : CSSValue(kIdentifierClass) { 2140 : CSSValue(kIdentifierClass) {
2166 switch (e) { 2141 switch (e) {
2167 case EOrder::kLogical: 2142 case EOrder::kLogical:
2168 value_id_ = CSSValueLogical; 2143 value_id_ = CSSValueLogical;
2169 break; 2144 break;
2170 case EOrder::kVisual: 2145 case EOrder::kVisual:
2171 value_id_ = CSSValueVisual; 2146 value_id_ = CSSValueVisual;
2172 break; 2147 break;
2173 } 2148 }
2174 } 2149 }
2175 2150
2176 template <> 2151 template <>
2177 inline ESpeak CSSIdentifierValue::ConvertTo() const {
2178 switch (value_id_) {
2179 case CSSValueNone:
2180 return ESpeak::kNone;
2181 case CSSValueNormal:
2182 return ESpeak::kNormal;
2183 case CSSValueSpellOut:
2184 return ESpeak::kSpellOut;
2185 case CSSValueDigits:
2186 return ESpeak::kDigits;
2187 case CSSValueLiteralPunctuation:
2188 return ESpeak::kLiteralPunctuation;
2189 case CSSValueNoPunctuation:
2190 return ESpeak::kNoPunctuation;
2191 default:
2192 break;
2193 }
2194
2195 NOTREACHED();
2196 return ESpeak::kNormal;
2197 }
2198
2199 template <>
2200 inline CSSIdentifierValue::CSSIdentifierValue(WebBlendMode blend_mode) 2152 inline CSSIdentifierValue::CSSIdentifierValue(WebBlendMode blend_mode)
2201 : CSSValue(kIdentifierClass) { 2153 : CSSValue(kIdentifierClass) {
2202 switch (blend_mode) { 2154 switch (blend_mode) {
2203 case kWebBlendModeNormal: 2155 case kWebBlendModeNormal:
2204 value_id_ = CSSValueNormal; 2156 value_id_ = CSSValueNormal;
2205 break; 2157 break;
2206 case kWebBlendModeMultiply: 2158 case kWebBlendModeMultiply:
2207 value_id_ = CSSValueMultiply; 2159 value_id_ = CSSValueMultiply;
2208 break; 2160 break;
2209 case kWebBlendModeScreen: 2161 case kWebBlendModeScreen:
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3320 default: 3272 default:
3321 break; 3273 break;
3322 } 3274 }
3323 NOTREACHED(); 3275 NOTREACHED();
3324 return kContainsNone; 3276 return kContainsNone;
3325 } 3277 }
3326 3278
3327 } // namespace blink 3279 } // namespace blink
3328 3280
3329 #endif 3281 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSProperties.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698