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

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

Issue 2890733002: Make EBorderStyle an enum class. (Closed)
Patch Set: Build for Mac Created 3 years, 7 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/CollapsedBorderValue.h » ('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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // fall-through 190 // fall-through
191 case CSSValueNone: 191 case CSSValueNone:
192 return kColumnSpanNone; 192 return kColumnSpanNone;
193 } 193 }
194 } 194 }
195 195
196 template <> 196 template <>
197 inline CSSIdentifierValue::CSSIdentifierValue(EBorderStyle e) 197 inline CSSIdentifierValue::CSSIdentifierValue(EBorderStyle e)
198 : CSSValue(kIdentifierClass) { 198 : CSSValue(kIdentifierClass) {
199 switch (e) { 199 switch (e) {
200 case kBorderStyleNone: 200 case EBorderStyle::kNone:
201 value_id_ = CSSValueNone; 201 value_id_ = CSSValueNone;
202 break; 202 break;
203 case kBorderStyleHidden: 203 case EBorderStyle::kHidden:
204 value_id_ = CSSValueHidden; 204 value_id_ = CSSValueHidden;
205 break; 205 break;
206 case kBorderStyleInset: 206 case EBorderStyle::kInset:
207 value_id_ = CSSValueInset; 207 value_id_ = CSSValueInset;
208 break; 208 break;
209 case kBorderStyleGroove: 209 case EBorderStyle::kGroove:
210 value_id_ = CSSValueGroove; 210 value_id_ = CSSValueGroove;
211 break; 211 break;
212 case kBorderStyleRidge: 212 case EBorderStyle::kRidge:
213 value_id_ = CSSValueRidge; 213 value_id_ = CSSValueRidge;
214 break; 214 break;
215 case kBorderStyleOutset: 215 case EBorderStyle::kOutset:
216 value_id_ = CSSValueOutset; 216 value_id_ = CSSValueOutset;
217 break; 217 break;
218 case kBorderStyleDotted: 218 case EBorderStyle::kDotted:
219 value_id_ = CSSValueDotted; 219 value_id_ = CSSValueDotted;
220 break; 220 break;
221 case kBorderStyleDashed: 221 case EBorderStyle::kDashed:
222 value_id_ = CSSValueDashed; 222 value_id_ = CSSValueDashed;
223 break; 223 break;
224 case kBorderStyleSolid: 224 case EBorderStyle::kSolid:
225 value_id_ = CSSValueSolid; 225 value_id_ = CSSValueSolid;
226 break; 226 break;
227 case kBorderStyleDouble: 227 case EBorderStyle::kDouble:
228 value_id_ = CSSValueDouble; 228 value_id_ = CSSValueDouble;
229 break; 229 break;
230 } 230 }
231 } 231 }
232 232
233 template <> 233 template <>
234 inline EBorderStyle CSSIdentifierValue::ConvertTo() const { 234 inline EBorderStyle CSSIdentifierValue::ConvertTo() const {
235 if (value_id_ == CSSValueAuto) // Valid for CSS outline-style 235 if (value_id_ == CSSValueAuto) // Valid for CSS outline-style
236 return kBorderStyleDotted; 236 return EBorderStyle::kDotted;
237 return (EBorderStyle)(value_id_ - CSSValueNone); 237 return (EBorderStyle)(value_id_ - CSSValueNone);
238 } 238 }
239 239
240 template <> 240 template <>
241 inline OutlineIsAuto CSSIdentifierValue::ConvertTo() const { 241 inline OutlineIsAuto CSSIdentifierValue::ConvertTo() const {
242 if (value_id_ == CSSValueAuto) 242 if (value_id_ == CSSValueAuto)
243 return kOutlineIsAutoOn; 243 return kOutlineIsAutoOn;
244 return kOutlineIsAutoOff; 244 return kOutlineIsAutoOff;
245 } 245 }
246 246
(...skipping 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3357 default: 3357 default:
3358 break; 3358 break;
3359 } 3359 }
3360 NOTREACHED(); 3360 NOTREACHED();
3361 return kContainsNone; 3361 return kContainsNone;
3362 } 3362 }
3363 3363
3364 } // namespace blink 3364 } // namespace blink
3365 3365
3366 #endif 3366 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/CollapsedBorderValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698