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

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

Issue 2911963004: Generate enum/getters/setters/mappings for user-select. (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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 return EUserModify::kReadWritePlaintextOnly; 1251 return EUserModify::kReadWritePlaintextOnly;
1252 default: 1252 default:
1253 break; 1253 break;
1254 } 1254 }
1255 1255
1256 NOTREACHED(); 1256 NOTREACHED();
1257 return EUserModify::kReadOnly; 1257 return EUserModify::kReadOnly;
1258 } 1258 }
1259 1259
1260 template <> 1260 template <>
1261 inline CSSIdentifierValue::CSSIdentifierValue(EUserSelect e)
1262 : CSSValue(kIdentifierClass) {
1263 switch (e) {
1264 case EUserSelect::kNone:
1265 value_id_ = CSSValueNone;
1266 break;
1267 case EUserSelect::kText:
1268 value_id_ = CSSValueText;
1269 break;
1270 case EUserSelect::kAll:
1271 value_id_ = CSSValueAll;
1272 break;
1273 }
1274 }
1275
1276 template <>
1277 inline EUserSelect CSSIdentifierValue::ConvertTo() const {
1278 switch (value_id_) {
1279 case CSSValueAuto:
1280 return EUserSelect::kText;
1281 case CSSValueNone:
1282 return EUserSelect::kNone;
1283 case CSSValueText:
1284 return EUserSelect::kText;
1285 case CSSValueAll:
1286 return EUserSelect::kAll;
1287 default:
1288 break;
1289 }
1290
1291 NOTREACHED();
1292 return EUserSelect::kText;
1293 }
1294
1295 template <>
1296 inline CSSIdentifierValue::CSSIdentifierValue(EVerticalAlign a) 1261 inline CSSIdentifierValue::CSSIdentifierValue(EVerticalAlign a)
1297 : CSSValue(kIdentifierClass) { 1262 : CSSValue(kIdentifierClass) {
1298 switch (a) { 1263 switch (a) {
1299 case EVerticalAlign::kTop: 1264 case EVerticalAlign::kTop:
1300 value_id_ = CSSValueTop; 1265 value_id_ = CSSValueTop;
1301 break; 1266 break;
1302 case EVerticalAlign::kBottom: 1267 case EVerticalAlign::kBottom:
1303 value_id_ = CSSValueBottom; 1268 value_id_ = CSSValueBottom;
1304 break; 1269 break;
1305 case EVerticalAlign::kMiddle: 1270 case EVerticalAlign::kMiddle:
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
3080 default: 3045 default:
3081 break; 3046 break;
3082 } 3047 }
3083 NOTREACHED(); 3048 NOTREACHED();
3084 return kContainsNone; 3049 return kContainsNone;
3085 } 3050 }
3086 3051
3087 } // namespace blink 3052 } // namespace blink
3088 3053
3089 #endif 3054 #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