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

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

Issue 2880573002: Store border-*-style on SurroundData in ComputedStyle (Closed)
Patch Set: Merge branch 'enumClass' into borderStyle 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/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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return kColumnSpanAll; 187 return kColumnSpanAll;
188 default: 188 default:
189 NOTREACHED(); 189 NOTREACHED();
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)
198 : CSSValue(kIdentifierClass) {
199 switch (e) {
200 case EBorderStyle::kNone:
201 value_id_ = CSSValueNone;
202 break;
203 case EBorderStyle::kHidden:
204 value_id_ = CSSValueHidden;
205 break;
206 case EBorderStyle::kInset:
207 value_id_ = CSSValueInset;
208 break;
209 case EBorderStyle::kGroove:
210 value_id_ = CSSValueGroove;
211 break;
212 case EBorderStyle::kRidge:
213 value_id_ = CSSValueRidge;
214 break;
215 case EBorderStyle::kOutset:
216 value_id_ = CSSValueOutset;
217 break;
218 case EBorderStyle::kDotted:
219 value_id_ = CSSValueDotted;
220 break;
221 case EBorderStyle::kDashed:
222 value_id_ = CSSValueDashed;
223 break;
224 case EBorderStyle::kSolid:
225 value_id_ = CSSValueSolid;
226 break;
227 case EBorderStyle::kDouble:
228 value_id_ = CSSValueDouble;
229 break;
230 }
231 }
232
233 template <>
234 inline EBorderStyle CSSIdentifierValue::ConvertTo() const { 197 inline EBorderStyle CSSIdentifierValue::ConvertTo() const {
235 if (value_id_ == CSSValueAuto) // Valid for CSS outline-style 198 if (value_id_ == CSSValueAuto) // Valid for CSS outline-style
236 return EBorderStyle::kDotted; 199 return EBorderStyle::kDotted;
237 return (EBorderStyle)(value_id_ - CSSValueNone); 200 return detail::cssValueIDToPlatformEnumGenerated<EBorderStyle>(value_id_);
238 } 201 }
239 202
240 template <> 203 template <>
241 inline OutlineIsAuto CSSIdentifierValue::ConvertTo() const { 204 inline OutlineIsAuto CSSIdentifierValue::ConvertTo() const {
242 if (value_id_ == CSSValueAuto) 205 if (value_id_ == CSSValueAuto)
243 return kOutlineIsAutoOn; 206 return kOutlineIsAutoOn;
244 return kOutlineIsAutoOff; 207 return kOutlineIsAutoOff;
245 } 208 }
246 209
247 template <> 210 template <>
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3357 default: 3320 default:
3358 break; 3321 break;
3359 } 3322 }
3360 NOTREACHED(); 3323 NOTREACHED();
3361 return kContainsNone; 3324 return kContainsNone;
3362 } 3325 }
3363 3326
3364 } // namespace blink 3327 } // namespace blink
3365 3328
3366 #endif 3329 #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