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 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 case CSSValueSmooth: | 3206 case CSSValueSmooth: |
3207 return kScrollBehaviorSmooth; | 3207 return kScrollBehaviorSmooth; |
3208 default: | 3208 default: |
3209 break; | 3209 break; |
3210 } | 3210 } |
3211 NOTREACHED(); | 3211 NOTREACHED(); |
3212 return kScrollBehaviorAuto; | 3212 return kScrollBehaviorAuto; |
3213 } | 3213 } |
3214 | 3214 |
3215 template <> | 3215 template <> |
| 3216 inline CSSIdentifierValue::CSSIdentifierValue( |
| 3217 EScrollBoundaryBehavior boundary_behavior) |
| 3218 : CSSValue(kIdentifierClass) { |
| 3219 switch (boundary_behavior) { |
| 3220 case EScrollBoundaryBehavior::kAuto: |
| 3221 value_id_ = CSSValueAuto; |
| 3222 break; |
| 3223 case EScrollBoundaryBehavior::kContain: |
| 3224 value_id_ = CSSValueContain; |
| 3225 break; |
| 3226 case EScrollBoundaryBehavior::kNone: |
| 3227 value_id_ = CSSValueNone; |
| 3228 break; |
| 3229 } |
| 3230 } |
| 3231 |
| 3232 template <> |
| 3233 inline EScrollBoundaryBehavior CSSIdentifierValue::ConvertTo() const { |
| 3234 switch (GetValueID()) { |
| 3235 case CSSValueAuto: |
| 3236 return EScrollBoundaryBehavior::kAuto; |
| 3237 case CSSValueContain: |
| 3238 return EScrollBoundaryBehavior::kContain; |
| 3239 case CSSValueNone: |
| 3240 return EScrollBoundaryBehavior::kNone; |
| 3241 default: |
| 3242 break; |
| 3243 } |
| 3244 NOTREACHED(); |
| 3245 return EScrollBoundaryBehavior::kAuto; |
| 3246 } |
| 3247 |
| 3248 template <> |
3216 inline CSSIdentifierValue::CSSIdentifierValue(ScrollSnapType snap_type) | 3249 inline CSSIdentifierValue::CSSIdentifierValue(ScrollSnapType snap_type) |
3217 : CSSValue(kIdentifierClass) { | 3250 : CSSValue(kIdentifierClass) { |
3218 switch (snap_type) { | 3251 switch (snap_type) { |
3219 case kScrollSnapTypeNone: | 3252 case kScrollSnapTypeNone: |
3220 value_id_ = CSSValueNone; | 3253 value_id_ = CSSValueNone; |
3221 break; | 3254 break; |
3222 case kScrollSnapTypeMandatory: | 3255 case kScrollSnapTypeMandatory: |
3223 value_id_ = CSSValueMandatory; | 3256 value_id_ = CSSValueMandatory; |
3224 break; | 3257 break; |
3225 case kScrollSnapTypeProximity: | 3258 case kScrollSnapTypeProximity: |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3292 default: | 3325 default: |
3293 break; | 3326 break; |
3294 } | 3327 } |
3295 NOTREACHED(); | 3328 NOTREACHED(); |
3296 return kContainsNone; | 3329 return kContainsNone; |
3297 } | 3330 } |
3298 | 3331 |
3299 } // namespace blink | 3332 } // namespace blink |
3300 | 3333 |
3301 #endif | 3334 #endif |
OLD | NEW |