| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "core/animation/animatable/AnimatableShapeValue.h" | 49 #include "core/animation/animatable/AnimatableShapeValue.h" |
| 50 #include "core/animation/animatable/AnimatableStrokeDasharrayList.h" | 50 #include "core/animation/animatable/AnimatableStrokeDasharrayList.h" |
| 51 #include "core/animation/animatable/AnimatableTransform.h" | 51 #include "core/animation/animatable/AnimatableTransform.h" |
| 52 #include "core/animation/animatable/AnimatableUnknown.h" | 52 #include "core/animation/animatable/AnimatableUnknown.h" |
| 53 #include "core/animation/animatable/AnimatableValue.h" | 53 #include "core/animation/animatable/AnimatableValue.h" |
| 54 #include "core/animation/animatable/AnimatableVisibility.h" | 54 #include "core/animation/animatable/AnimatableVisibility.h" |
| 55 #include "core/css/CSSPrimitiveValueMappings.h" | 55 #include "core/css/CSSPrimitiveValueMappings.h" |
| 56 #include "core/css/CSSPropertyMetadata.h" | 56 #include "core/css/CSSPropertyMetadata.h" |
| 57 #include "core/css/resolver/StyleBuilder.h" | 57 #include "core/css/resolver/StyleBuilder.h" |
| 58 #include "core/css/resolver/StyleResolverState.h" | 58 #include "core/css/resolver/StyleResolverState.h" |
| 59 #include "core/layout/style/LayoutStyle.h" | 59 #include "core/layout/style/ComputedStyle.h" |
| 60 #include "wtf/MathExtras.h" | 60 #include "wtf/MathExtras.h" |
| 61 #include "wtf/TypeTraits.h" | 61 #include "wtf/TypeTraits.h" |
| 62 | 62 |
| 63 namespace blink { | 63 namespace blink { |
| 64 | 64 |
| 65 namespace { | 65 namespace { |
| 66 | 66 |
| 67 Length animatableValueToLengthWithZoom(const AnimatableValue* value, float zoom,
ValueRange range = ValueRangeAll) | 67 Length animatableValueToLengthWithZoom(const AnimatableValue* value, float zoom,
ValueRange range = ValueRangeAll) |
| 68 { | 68 { |
| 69 if (value->isLength()) | 69 if (value->isLength()) |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } // namespace | 268 } // namespace |
| 269 | 269 |
| 270 // FIXME: Generate this function. | 270 // FIXME: Generate this function. |
| 271 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
ate& state, const AnimatableValue* value) | 271 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
ate& state, const AnimatableValue* value) |
| 272 { | 272 { |
| 273 ASSERT(CSSPropertyMetadata::isAnimatableProperty(property)); | 273 ASSERT(CSSPropertyMetadata::isAnimatableProperty(property)); |
| 274 if (value->isUnknown()) { | 274 if (value->isUnknown()) { |
| 275 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)-
>toCSSValue().get()); | 275 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)-
>toCSSValue().get()); |
| 276 return; | 276 return; |
| 277 } | 277 } |
| 278 LayoutStyle* style = state.style(); | 278 ComputedStyle* style = state.style(); |
| 279 switch (property) { | 279 switch (property) { |
| 280 case CSSPropertyBackgroundColor: | 280 case CSSPropertyBackgroundColor: |
| 281 style->setBackgroundColor(toAnimatableColor(value)->color()); | 281 style->setBackgroundColor(toAnimatableColor(value)->color()); |
| 282 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi
nkColor()); | 282 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi
nkColor()); |
| 283 return; | 283 return; |
| 284 case CSSPropertyBackgroundImage: | 284 case CSSPropertyBackgroundImage: |
| 285 setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayer
s(), value, state); | 285 setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayer
s(), value, state); |
| 286 return; | 286 return; |
| 287 case CSSPropertyBackgroundPositionX: | 287 case CSSPropertyBackgroundPositionX: |
| 288 setOnFillLayers<CSSPropertyBackgroundPositionX>(style->accessBackgroundL
ayers(), value, state); | 288 setOnFillLayers<CSSPropertyBackgroundPositionX>(style->accessBackgroundL
ayers(), value, state); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 case CSSPropertyRy: | 667 case CSSPropertyRy: |
| 668 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative
)); | 668 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative
)); |
| 669 return; | 669 return; |
| 670 | 670 |
| 671 default: | 671 default: |
| 672 ASSERT_NOT_REACHED(); | 672 ASSERT_NOT_REACHED(); |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 | 675 |
| 676 } // namespace blink | 676 } // namespace blink |
| OLD | NEW |