OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |