OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/animation/StringKeyframe.h" | 6 #include "core/animation/StringKeyframe.h" |
7 | 7 |
8 #include "core/XLinkNames.h" | 8 #include "core/XLinkNames.h" |
9 #include "core/animation/AngleSVGInterpolation.h" | 9 #include "core/animation/AngleSVGInterpolation.h" |
10 #include "core/animation/CSSColorInterpolationType.h" | 10 #include "core/animation/CSSColorInterpolationType.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "core/animation/LengthBoxStyleInterpolation.h" | 30 #include "core/animation/LengthBoxStyleInterpolation.h" |
31 #include "core/animation/LengthPairStyleInterpolation.h" | 31 #include "core/animation/LengthPairStyleInterpolation.h" |
32 #include "core/animation/LengthSVGInterpolation.h" | 32 #include "core/animation/LengthSVGInterpolation.h" |
33 #include "core/animation/LengthStyleInterpolation.h" | 33 #include "core/animation/LengthStyleInterpolation.h" |
34 #include "core/animation/ListSVGInterpolation.h" | 34 #include "core/animation/ListSVGInterpolation.h" |
35 #include "core/animation/ListStyleInterpolation.h" | 35 #include "core/animation/ListStyleInterpolation.h" |
36 #include "core/animation/NumberOptionalNumberSVGInterpolation.h" | 36 #include "core/animation/NumberOptionalNumberSVGInterpolation.h" |
37 #include "core/animation/NumberSVGInterpolation.h" | 37 #include "core/animation/NumberSVGInterpolation.h" |
38 #include "core/animation/PathSVGInterpolation.h" | 38 #include "core/animation/PathSVGInterpolation.h" |
39 #include "core/animation/PointSVGInterpolation.h" | 39 #include "core/animation/PointSVGInterpolation.h" |
40 #include "core/animation/RectSVGInterpolation.h" | |
41 #include "core/animation/SVGAngleInterpolationType.h" | 40 #include "core/animation/SVGAngleInterpolationType.h" |
42 #include "core/animation/SVGNumberInterpolationType.h" | 41 #include "core/animation/SVGNumberInterpolationType.h" |
| 42 #include "core/animation/SVGRectInterpolationType.h" |
43 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" | 43 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
44 #include "core/animation/SVGValueInterpolationType.h" | 44 #include "core/animation/SVGValueInterpolationType.h" |
45 #include "core/animation/TransformSVGInterpolation.h" | 45 #include "core/animation/TransformSVGInterpolation.h" |
46 #include "core/animation/VisibilityStyleInterpolation.h" | 46 #include "core/animation/VisibilityStyleInterpolation.h" |
47 #include "core/animation/css/CSSAnimations.h" | 47 #include "core/animation/css/CSSAnimations.h" |
48 #include "core/css/CSSPropertyMetadata.h" | 48 #include "core/css/CSSPropertyMetadata.h" |
49 #include "core/css/resolver/StyleResolver.h" | 49 #include "core/css/resolver/StyleResolver.h" |
50 #include "core/style/ComputedStyle.h" | 50 #include "core/style/ComputedStyle.h" |
51 #include "core/svg/SVGElement.h" | 51 #include "core/svg/SVGElement.h" |
52 #include "platform/RuntimeEnabledFeatures.h" | 52 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 || attribute == SVGNames::stitchTilesAttr | 315 || attribute == SVGNames::stitchTilesAttr |
316 || attribute == SVGNames::targetAttr | 316 || attribute == SVGNames::targetAttr |
317 || attribute == SVGNames::typeAttr | 317 || attribute == SVGNames::typeAttr |
318 || attribute == SVGNames::xChannelSelectorAttr | 318 || attribute == SVGNames::xChannelSelectorAttr |
319 || attribute == SVGNames::yChannelSelectorAttr | 319 || attribute == SVGNames::yChannelSelectorAttr |
320 || attribute == XLinkNames::hrefAttr) { | 320 || attribute == XLinkNames::hrefAttr) { |
321 // Use default SVGValueInterpolationType. | 321 // Use default SVGValueInterpolationType. |
322 applicableTypes->append(new SVGValueInterpolationType(attribute)); | 322 applicableTypes->append(new SVGValueInterpolationType(attribute)); |
323 } else if (attribute == SVGNames::orientAttr) { | 323 } else if (attribute == SVGNames::orientAttr) { |
324 applicableTypes->append(new SVGAngleInterpolationType(attribute)); | 324 applicableTypes->append(new SVGAngleInterpolationType(attribute)); |
| 325 } else if (attribute == SVGNames::viewBoxAttr) { |
| 326 applicableTypes->append(new SVGRectInterpolationType(attribute)); |
325 } else { | 327 } else { |
326 fallbackToLegacy = true; | 328 fallbackToLegacy = true; |
327 } | 329 } |
328 | 330 |
329 if (!fallbackToLegacy) | 331 if (!fallbackToLegacy) |
330 applicableTypes->append(new SVGValueInterpolationType(attribute)); | 332 applicableTypes->append(new SVGValueInterpolationType(attribute)); |
331 } | 333 } |
332 | 334 |
333 if (fallbackToLegacy) { | 335 if (fallbackToLegacy) { |
334 delete applicableTypes; | 336 delete applicableTypes; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 return NumberOptionalNumberSVGInterpolation::create(fromValue, toValue,
attribute); | 575 return NumberOptionalNumberSVGInterpolation::create(fromValue, toValue,
attribute); |
574 case AnimatedNumberList: | 576 case AnimatedNumberList: |
575 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | 577 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
576 break; | 578 break; |
577 case AnimatedPath: | 579 case AnimatedPath: |
578 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); | 580 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); |
579 break; | 581 break; |
580 case AnimatedPoints: | 582 case AnimatedPoints: |
581 interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate
(fromValue, toValue, attribute); | 583 interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate
(fromValue, toValue, attribute); |
582 break; | 584 break; |
583 case AnimatedRect: | |
584 return RectSVGInterpolation::create(fromValue, toValue, attribute); | |
585 case AnimatedTransformList: | 585 case AnimatedTransformList: |
586 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); | 586 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); |
587 break; | 587 break; |
588 | 588 |
589 // Handled by SVGInterpolationTypes. | 589 // Handled by SVGInterpolationTypes. |
590 case AnimatedAngle: | 590 case AnimatedAngle: |
| 591 case AnimatedRect: |
591 case AnimatedNumber: | 592 case AnimatedNumber: |
592 ASSERT_NOT_REACHED(); | 593 ASSERT_NOT_REACHED(); |
593 // Fallthrough. | 594 // Fallthrough. |
594 | 595 |
595 // TODO(ericwilligers): Support more animation types. | 596 // TODO(ericwilligers): Support more animation types. |
596 default: | 597 default: |
597 break; | 598 break; |
598 } | 599 } |
599 if (interpolation) | 600 if (interpolation) |
600 return interpolation.release(); | 601 return interpolation.release(); |
(...skipping 16 matching lines...) Expand all Loading... |
617 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 618 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
618 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 619 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
619 | 620 |
620 if (!fromValue || !toValue) | 621 if (!fromValue || !toValue) |
621 return nullptr; | 622 return nullptr; |
622 | 623 |
623 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 624 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
624 } | 625 } |
625 | 626 |
626 } // namespace blink | 627 } // namespace blink |
OLD | NEW |