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 26 matching lines...) Expand all Loading... |
37 #include "core/animation/animatable/AnimatableDouble.h" | 37 #include "core/animation/animatable/AnimatableDouble.h" |
38 #include "core/animation/animatable/AnimatableDoubleAndBool.h" | 38 #include "core/animation/animatable/AnimatableDoubleAndBool.h" |
39 #include "core/animation/animatable/AnimatableFilterOperations.h" | 39 #include "core/animation/animatable/AnimatableFilterOperations.h" |
40 #include "core/animation/animatable/AnimatableImage.h" | 40 #include "core/animation/animatable/AnimatableImage.h" |
41 #include "core/animation/animatable/AnimatableLength.h" | 41 #include "core/animation/animatable/AnimatableLength.h" |
42 #include "core/animation/animatable/AnimatableLengthBox.h" | 42 #include "core/animation/animatable/AnimatableLengthBox.h" |
43 #include "core/animation/animatable/AnimatableLengthBoxAndBool.h" | 43 #include "core/animation/animatable/AnimatableLengthBoxAndBool.h" |
44 #include "core/animation/animatable/AnimatableLengthPoint.h" | 44 #include "core/animation/animatable/AnimatableLengthPoint.h" |
45 #include "core/animation/animatable/AnimatableLengthPoint3D.h" | 45 #include "core/animation/animatable/AnimatableLengthPoint3D.h" |
46 #include "core/animation/animatable/AnimatableLengthSize.h" | 46 #include "core/animation/animatable/AnimatableLengthSize.h" |
| 47 #include "core/animation/animatable/AnimatablePath.h" |
47 #include "core/animation/animatable/AnimatableRepeatable.h" | 48 #include "core/animation/animatable/AnimatableRepeatable.h" |
48 #include "core/animation/animatable/AnimatableSVGPaint.h" | 49 #include "core/animation/animatable/AnimatableSVGPaint.h" |
49 #include "core/animation/animatable/AnimatableShadow.h" | 50 #include "core/animation/animatable/AnimatableShadow.h" |
50 #include "core/animation/animatable/AnimatableShapeValue.h" | 51 #include "core/animation/animatable/AnimatableShapeValue.h" |
51 #include "core/animation/animatable/AnimatableStrokeDasharrayList.h" | 52 #include "core/animation/animatable/AnimatableStrokeDasharrayList.h" |
52 #include "core/animation/animatable/AnimatableTransform.h" | 53 #include "core/animation/animatable/AnimatableTransform.h" |
53 #include "core/animation/animatable/AnimatableUnknown.h" | 54 #include "core/animation/animatable/AnimatableUnknown.h" |
54 #include "core/animation/animatable/AnimatableVisibility.h" | 55 #include "core/animation/animatable/AnimatableVisibility.h" |
55 #include "core/css/CSSCalculationValue.h" | 56 #include "core/css/CSSCalculationValue.h" |
56 #include "core/css/CSSPrimitiveValue.h" | 57 #include "core/css/CSSPrimitiveValue.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 return AnimatableColor::create(color, visitedLinkColor); | 241 return AnimatableColor::create(color, visitedLinkColor); |
241 } | 242 } |
242 | 243 |
243 inline static PassRefPtr<AnimatableValue> createFromShapeValue(ShapeValue* value
) | 244 inline static PassRefPtr<AnimatableValue> createFromShapeValue(ShapeValue* value
) |
244 { | 245 { |
245 if (value) | 246 if (value) |
246 return AnimatableShapeValue::create(value); | 247 return AnimatableShapeValue::create(value); |
247 return AnimatableUnknown::create(CSSValueNone); | 248 return AnimatableUnknown::create(CSSValueNone); |
248 } | 249 } |
249 | 250 |
| 251 static PassRefPtr<AnimatableValue> createFromPath(CSSPathValue* pathValue) |
| 252 { |
| 253 return AnimatablePath::create(pathValue); |
| 254 } |
| 255 |
250 static double fontStretchToDouble(FontStretch fontStretch) | 256 static double fontStretchToDouble(FontStretch fontStretch) |
251 { | 257 { |
252 return static_cast<unsigned>(fontStretch); | 258 return static_cast<unsigned>(fontStretch); |
253 } | 259 } |
254 | 260 |
255 static PassRefPtr<AnimatableValue> createFromFontStretch(FontStretch fontStretch
) | 261 static PassRefPtr<AnimatableValue> createFromFontStretch(FontStretch fontStretch
) |
256 { | 262 { |
257 return createFromDouble(fontStretchToDouble(fontStretch)); | 263 return createFromDouble(fontStretchToDouble(fontStretch)); |
258 } | 264 } |
259 | 265 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 case CSSPropertyWidth: | 572 case CSSPropertyWidth: |
567 return createFromLength(style.width(), style); | 573 return createFromLength(style.width(), style); |
568 case CSSPropertyWordSpacing: | 574 case CSSPropertyWordSpacing: |
569 return createFromDouble(style.wordSpacing()); | 575 return createFromDouble(style.wordSpacing()); |
570 case CSSPropertyVerticalAlign: | 576 case CSSPropertyVerticalAlign: |
571 if (style.verticalAlign() == LENGTH) | 577 if (style.verticalAlign() == LENGTH) |
572 return createFromLength(style.verticalAlignLength(), style); | 578 return createFromLength(style.verticalAlignLength(), style); |
573 return AnimatableUnknown::create(CSSPrimitiveValue::create(style.vertica
lAlign())); | 579 return AnimatableUnknown::create(CSSPrimitiveValue::create(style.vertica
lAlign())); |
574 case CSSPropertyVisibility: | 580 case CSSPropertyVisibility: |
575 return AnimatableVisibility::create(style.visibility()); | 581 return AnimatableVisibility::create(style.visibility()); |
| 582 case CSSPropertyD: |
| 583 return createFromPath(style.svgStyle().d()); |
576 case CSSPropertyCx: | 584 case CSSPropertyCx: |
577 return createFromLength(style.svgStyle().cx(), style); | 585 return createFromLength(style.svgStyle().cx(), style); |
578 case CSSPropertyCy: | 586 case CSSPropertyCy: |
579 return createFromLength(style.svgStyle().cy(), style); | 587 return createFromLength(style.svgStyle().cy(), style); |
580 case CSSPropertyX: | 588 case CSSPropertyX: |
581 return createFromLength(style.svgStyle().x(), style); | 589 return createFromLength(style.svgStyle().x(), style); |
582 case CSSPropertyY: | 590 case CSSPropertyY: |
583 return createFromLength(style.svgStyle().y(), style); | 591 return createFromLength(style.svgStyle().y(), style); |
584 case CSSPropertyR: | 592 case CSSPropertyR: |
585 return createFromLength(style.svgStyle().r(), style); | 593 return createFromLength(style.svgStyle().r(), style); |
586 case CSSPropertyRx: | 594 case CSSPropertyRx: |
587 return createFromLength(style.svgStyle().rx(), style); | 595 return createFromLength(style.svgStyle().rx(), style); |
588 case CSSPropertyRy: | 596 case CSSPropertyRy: |
589 return createFromLength(style.svgStyle().ry(), style); | 597 return createFromLength(style.svgStyle().ry(), style); |
590 case CSSPropertyZIndex: | 598 case CSSPropertyZIndex: |
591 if (style.hasAutoZIndex()) | 599 if (style.hasAutoZIndex()) |
592 return AnimatableUnknown::create(CSSValueAuto); | 600 return AnimatableUnknown::create(CSSValueAuto); |
593 return createFromDouble(style.zIndex()); | 601 return createFromDouble(style.zIndex()); |
594 default: | 602 default: |
595 ASSERT_NOT_REACHED(); | 603 ASSERT_NOT_REACHED(); |
596 return nullptr; | 604 return nullptr; |
597 } | 605 } |
598 } | 606 } |
599 | 607 |
600 } // namespace blink | 608 } // namespace blink |
OLD | NEW |