| 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/CSSColorInterpolationType.h" | 9 #include "core/animation/CSSColorInterpolationType.h" |
| 10 #include "core/animation/CSSImageInterpolationType.h" | 10 #include "core/animation/CSSImageInterpolationType.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "core/animation/InvalidatableInterpolation.h" | 25 #include "core/animation/InvalidatableInterpolation.h" |
| 26 #include "core/animation/LegacyStyleInterpolation.h" | 26 #include "core/animation/LegacyStyleInterpolation.h" |
| 27 #include "core/animation/LengthBoxStyleInterpolation.h" | 27 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 28 #include "core/animation/LengthPairStyleInterpolation.h" | 28 #include "core/animation/LengthPairStyleInterpolation.h" |
| 29 #include "core/animation/LengthSVGInterpolation.h" | 29 #include "core/animation/LengthSVGInterpolation.h" |
| 30 #include "core/animation/LengthStyleInterpolation.h" | 30 #include "core/animation/LengthStyleInterpolation.h" |
| 31 #include "core/animation/ListSVGInterpolation.h" | 31 #include "core/animation/ListSVGInterpolation.h" |
| 32 #include "core/animation/ListStyleInterpolation.h" | 32 #include "core/animation/ListStyleInterpolation.h" |
| 33 #include "core/animation/NumberSVGInterpolation.h" | 33 #include "core/animation/NumberSVGInterpolation.h" |
| 34 #include "core/animation/PathSVGInterpolation.h" | 34 #include "core/animation/PathSVGInterpolation.h" |
| 35 #include "core/animation/RectSVGInterpolation.h" | |
| 36 #include "core/animation/SVGAngleInterpolationType.h" | 35 #include "core/animation/SVGAngleInterpolationType.h" |
| 37 #include "core/animation/SVGIntegerInterpolationType.h" | 36 #include "core/animation/SVGIntegerInterpolationType.h" |
| 38 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" | 37 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" |
| 39 #include "core/animation/SVGNumberInterpolationType.h" | 38 #include "core/animation/SVGNumberInterpolationType.h" |
| 40 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" | 39 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" |
| 41 #include "core/animation/SVGPointListInterpolationType.h" | 40 #include "core/animation/SVGPointListInterpolationType.h" |
| 41 #include "core/animation/SVGRectInterpolationType.h" |
| 42 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" | 42 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
| 43 #include "core/animation/SVGValueInterpolationType.h" | 43 #include "core/animation/SVGValueInterpolationType.h" |
| 44 #include "core/animation/TransformSVGInterpolation.h" | 44 #include "core/animation/TransformSVGInterpolation.h" |
| 45 #include "core/animation/VisibilityStyleInterpolation.h" | 45 #include "core/animation/VisibilityStyleInterpolation.h" |
| 46 #include "core/animation/css/CSSAnimations.h" | 46 #include "core/animation/css/CSSAnimations.h" |
| 47 #include "core/css/CSSPropertyMetadata.h" | 47 #include "core/css/CSSPropertyMetadata.h" |
| 48 #include "core/css/resolver/StyleResolver.h" | 48 #include "core/css/resolver/StyleResolver.h" |
| 49 #include "core/style/ComputedStyle.h" | 49 #include "core/style/ComputedStyle.h" |
| 50 #include "core/svg/SVGElement.h" | 50 #include "core/svg/SVGElement.h" |
| 51 #include "platform/RuntimeEnabledFeatures.h" | 51 #include "platform/RuntimeEnabledFeatures.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 || attribute == SVGNames::surfaceScaleAttr | 300 || attribute == SVGNames::surfaceScaleAttr |
| 301 || attribute == SVGNames::zAttr) { | 301 || attribute == SVGNames::zAttr) { |
| 302 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); | 302 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); |
| 303 } else if (attribute == SVGNames::baseFrequencyAttr | 303 } else if (attribute == SVGNames::baseFrequencyAttr |
| 304 || attribute == SVGNames::kernelUnitLengthAttr | 304 || attribute == SVGNames::kernelUnitLengthAttr |
| 305 || attribute == SVGNames::radiusAttr | 305 || attribute == SVGNames::radiusAttr |
| 306 || attribute == SVGNames::stdDeviationAttr) { | 306 || attribute == SVGNames::stdDeviationAttr) { |
| 307 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); | 307 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); |
| 308 } else if (attribute == SVGNames::pointsAttr) { | 308 } else if (attribute == SVGNames::pointsAttr) { |
| 309 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); | 309 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); |
| 310 } else if (attribute == SVGNames::viewBoxAttr) { |
| 311 applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attrib
ute))); |
| 310 } else if (attribute == HTMLNames::classAttr | 312 } else if (attribute == HTMLNames::classAttr |
| 311 || attribute == SVGNames::clipPathUnitsAttr | 313 || attribute == SVGNames::clipPathUnitsAttr |
| 312 || attribute == SVGNames::edgeModeAttr | 314 || attribute == SVGNames::edgeModeAttr |
| 313 || attribute == SVGNames::filterUnitsAttr | 315 || attribute == SVGNames::filterUnitsAttr |
| 314 || attribute == SVGNames::gradientUnitsAttr | 316 || attribute == SVGNames::gradientUnitsAttr |
| 315 || attribute == SVGNames::inAttr | 317 || attribute == SVGNames::inAttr |
| 316 || attribute == SVGNames::in2Attr | 318 || attribute == SVGNames::in2Attr |
| 317 || attribute == SVGNames::lengthAdjustAttr | 319 || attribute == SVGNames::lengthAdjustAttr |
| 318 || attribute == SVGNames::markerUnitsAttr | 320 || attribute == SVGNames::markerUnitsAttr |
| 319 || attribute == SVGNames::maskContentUnitsAttr | 321 || attribute == SVGNames::maskContentUnitsAttr |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 return LengthSVGInterpolation::create(fromValue, toValue, attribute); | 572 return LengthSVGInterpolation::create(fromValue, toValue, attribute); |
| 571 case AnimatedLengthList: | 573 case AnimatedLengthList: |
| 572 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | 574 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
| 573 break; | 575 break; |
| 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 AnimatedRect: | |
| 581 return RectSVGInterpolation::create(fromValue, toValue, attribute); | |
| 582 case AnimatedTransformList: | 582 case AnimatedTransformList: |
| 583 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); | 583 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); |
| 584 break; | 584 break; |
| 585 | 585 |
| 586 // Handled by SVGInterpolationTypes. | 586 // Handled by SVGInterpolationTypes. |
| 587 case AnimatedAngle: | 587 case AnimatedAngle: |
| 588 case AnimatedInteger: | 588 case AnimatedInteger: |
| 589 case AnimatedIntegerOptionalInteger: | 589 case AnimatedIntegerOptionalInteger: |
| 590 case AnimatedNumber: | 590 case AnimatedNumber: |
| 591 case AnimatedNumberOptionalNumber: | 591 case AnimatedNumberOptionalNumber: |
| 592 case AnimatedPoints: | 592 case AnimatedPoints: |
| 593 case AnimatedRect: |
| 593 ASSERT_NOT_REACHED(); | 594 ASSERT_NOT_REACHED(); |
| 594 // Fallthrough. | 595 // Fallthrough. |
| 595 | 596 |
| 596 // TODO(ericwilligers): Support more animation types. | 597 // TODO(ericwilligers): Support more animation types. |
| 597 default: | 598 default: |
| 598 break; | 599 break; |
| 599 } | 600 } |
| 600 if (interpolation) | 601 if (interpolation) |
| 601 return interpolation.release(); | 602 return interpolation.release(); |
| 602 | 603 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 618 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 619 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
| 619 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 620 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
| 620 | 621 |
| 621 if (!fromValue || !toValue) | 622 if (!fromValue || !toValue) |
| 622 return nullptr; | 623 return nullptr; |
| 623 | 624 |
| 624 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 625 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
| 625 } | 626 } |
| 626 | 627 |
| 627 } // namespace blink | 628 } // namespace blink |
| OLD | NEW |