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 3260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3271 case CSSValueSmooth: | 3271 case CSSValueSmooth: |
3272 return kScrollBehaviorSmooth; | 3272 return kScrollBehaviorSmooth; |
3273 default: | 3273 default: |
3274 break; | 3274 break; |
3275 } | 3275 } |
3276 NOTREACHED(); | 3276 NOTREACHED(); |
3277 return kScrollBehaviorAuto; | 3277 return kScrollBehaviorAuto; |
3278 } | 3278 } |
3279 | 3279 |
3280 template <> | 3280 template <> |
| 3281 inline CSSIdentifierValue::CSSIdentifierValue( |
| 3282 EScrollBoundaryBehavior boundary_behavior) |
| 3283 : CSSValue(kIdentifierClass) { |
| 3284 switch (boundary_behavior) { |
| 3285 case EScrollBoundaryBehavior::kAuto: |
| 3286 value_id_ = CSSValueAuto; |
| 3287 break; |
| 3288 case EScrollBoundaryBehavior::kContain: |
| 3289 value_id_ = CSSValueContain; |
| 3290 break; |
| 3291 case EScrollBoundaryBehavior::kNone: |
| 3292 value_id_ = CSSValueNone; |
| 3293 break; |
| 3294 } |
| 3295 } |
| 3296 |
| 3297 template <> |
| 3298 inline EScrollBoundaryBehavior CSSIdentifierValue::ConvertTo() const { |
| 3299 switch (GetValueID()) { |
| 3300 case CSSValueAuto: |
| 3301 return EScrollBoundaryBehavior::kAuto; |
| 3302 case CSSValueContain: |
| 3303 return EScrollBoundaryBehavior::kContain; |
| 3304 case CSSValueNone: |
| 3305 return EScrollBoundaryBehavior::kNone; |
| 3306 default: |
| 3307 break; |
| 3308 } |
| 3309 NOTREACHED(); |
| 3310 return EScrollBoundaryBehavior::kAuto; |
| 3311 } |
| 3312 |
| 3313 template <> |
3281 inline CSSIdentifierValue::CSSIdentifierValue(ScrollSnapType snap_type) | 3314 inline CSSIdentifierValue::CSSIdentifierValue(ScrollSnapType snap_type) |
3282 : CSSValue(kIdentifierClass) { | 3315 : CSSValue(kIdentifierClass) { |
3283 switch (snap_type) { | 3316 switch (snap_type) { |
3284 case kScrollSnapTypeNone: | 3317 case kScrollSnapTypeNone: |
3285 value_id_ = CSSValueNone; | 3318 value_id_ = CSSValueNone; |
3286 break; | 3319 break; |
3287 case kScrollSnapTypeMandatory: | 3320 case kScrollSnapTypeMandatory: |
3288 value_id_ = CSSValueMandatory; | 3321 value_id_ = CSSValueMandatory; |
3289 break; | 3322 break; |
3290 case kScrollSnapTypeProximity: | 3323 case kScrollSnapTypeProximity: |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3357 default: | 3390 default: |
3358 break; | 3391 break; |
3359 } | 3392 } |
3360 NOTREACHED(); | 3393 NOTREACHED(); |
3361 return kContainsNone; | 3394 return kContainsNone; |
3362 } | 3395 } |
3363 | 3396 |
3364 } // namespace blink | 3397 } // namespace blink |
3365 | 3398 |
3366 #endif | 3399 #endif |
OLD | NEW |