| 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 13 matching lines...) Expand all Loading... |
| 24 #include "core/animation/IntegerOptionalIntegerSVGInterpolation.h" | 24 #include "core/animation/IntegerOptionalIntegerSVGInterpolation.h" |
| 25 #include "core/animation/InterpolationType.h" | 25 #include "core/animation/InterpolationType.h" |
| 26 #include "core/animation/InvalidatableInterpolation.h" | 26 #include "core/animation/InvalidatableInterpolation.h" |
| 27 #include "core/animation/LegacyStyleInterpolation.h" | 27 #include "core/animation/LegacyStyleInterpolation.h" |
| 28 #include "core/animation/LengthBoxStyleInterpolation.h" | 28 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 29 #include "core/animation/LengthPairStyleInterpolation.h" | 29 #include "core/animation/LengthPairStyleInterpolation.h" |
| 30 #include "core/animation/LengthSVGInterpolation.h" | 30 #include "core/animation/LengthSVGInterpolation.h" |
| 31 #include "core/animation/LengthStyleInterpolation.h" | 31 #include "core/animation/LengthStyleInterpolation.h" |
| 32 #include "core/animation/ListSVGInterpolation.h" | 32 #include "core/animation/ListSVGInterpolation.h" |
| 33 #include "core/animation/ListStyleInterpolation.h" | 33 #include "core/animation/ListStyleInterpolation.h" |
| 34 #include "core/animation/NumberOptionalNumberSVGInterpolation.h" | |
| 35 #include "core/animation/NumberSVGInterpolation.h" | 34 #include "core/animation/NumberSVGInterpolation.h" |
| 36 #include "core/animation/PathSVGInterpolation.h" | 35 #include "core/animation/PathSVGInterpolation.h" |
| 37 #include "core/animation/RectSVGInterpolation.h" | 36 #include "core/animation/RectSVGInterpolation.h" |
| 38 #include "core/animation/SVGAngleInterpolationType.h" | 37 #include "core/animation/SVGAngleInterpolationType.h" |
| 39 #include "core/animation/SVGIntegerInterpolationType.h" | 38 #include "core/animation/SVGIntegerInterpolationType.h" |
| 40 #include "core/animation/SVGNumberInterpolationType.h" | 39 #include "core/animation/SVGNumberInterpolationType.h" |
| 40 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" |
| 41 #include "core/animation/SVGPointListInterpolationType.h" | 41 #include "core/animation/SVGPointListInterpolationType.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" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 || attribute == SVGNames::pointsAtYAttr | 291 || attribute == SVGNames::pointsAtYAttr |
| 292 || attribute == SVGNames::pointsAtZAttr | 292 || attribute == SVGNames::pointsAtZAttr |
| 293 || attribute == SVGNames::scaleAttr | 293 || attribute == SVGNames::scaleAttr |
| 294 || attribute == SVGNames::seedAttr | 294 || attribute == SVGNames::seedAttr |
| 295 || attribute == SVGNames::slopeAttr | 295 || attribute == SVGNames::slopeAttr |
| 296 || attribute == SVGNames::specularConstantAttr | 296 || attribute == SVGNames::specularConstantAttr |
| 297 || attribute == SVGNames::specularExponentAttr | 297 || attribute == SVGNames::specularExponentAttr |
| 298 || attribute == SVGNames::surfaceScaleAttr | 298 || attribute == SVGNames::surfaceScaleAttr |
| 299 || attribute == SVGNames::zAttr) { | 299 || attribute == SVGNames::zAttr) { |
| 300 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); | 300 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); |
| 301 } else if (attribute == SVGNames::baseFrequencyAttr |
| 302 || attribute == SVGNames::kernelUnitLengthAttr |
| 303 || attribute == SVGNames::radiusAttr |
| 304 || attribute == SVGNames::stdDeviationAttr) { |
| 305 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); |
| 301 } else if (attribute == SVGNames::pointsAttr) { | 306 } else if (attribute == SVGNames::pointsAttr) { |
| 302 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); | 307 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); |
| 303 } else if (attribute == HTMLNames::classAttr | 308 } else if (attribute == HTMLNames::classAttr |
| 304 || attribute == SVGNames::clipPathUnitsAttr | 309 || attribute == SVGNames::clipPathUnitsAttr |
| 305 || attribute == SVGNames::edgeModeAttr | 310 || attribute == SVGNames::edgeModeAttr |
| 306 || attribute == SVGNames::filterUnitsAttr | 311 || attribute == SVGNames::filterUnitsAttr |
| 307 || attribute == SVGNames::gradientUnitsAttr | 312 || attribute == SVGNames::gradientUnitsAttr |
| 308 || attribute == SVGNames::inAttr | 313 || attribute == SVGNames::inAttr |
| 309 || attribute == SVGNames::in2Attr | 314 || attribute == SVGNames::in2Attr |
| 310 || attribute == SVGNames::lengthAdjustAttr | 315 || attribute == SVGNames::lengthAdjustAttr |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 switch (fromValue->type()) { | 566 switch (fromValue->type()) { |
| 562 case AnimatedIntegerOptionalInteger: { | 567 case AnimatedIntegerOptionalInteger: { |
| 563 int min = &attribute->attributeName() == &SVGNames::orderAttr ? 1 : 0; | 568 int min = &attribute->attributeName() == &SVGNames::orderAttr ? 1 : 0; |
| 564 return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue
, attribute, min); | 569 return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue
, attribute, min); |
| 565 } | 570 } |
| 566 case AnimatedLength: | 571 case AnimatedLength: |
| 567 return LengthSVGInterpolation::create(fromValue, toValue, attribute); | 572 return LengthSVGInterpolation::create(fromValue, toValue, attribute); |
| 568 case AnimatedLengthList: | 573 case AnimatedLengthList: |
| 569 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | 574 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
| 570 break; | 575 break; |
| 571 case AnimatedNumberOptionalNumber: | |
| 572 return NumberOptionalNumberSVGInterpolation::create(fromValue, toValue,
attribute); | |
| 573 case AnimatedNumberList: | 576 case AnimatedNumberList: |
| 574 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | 577 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
| 575 break; | 578 break; |
| 576 case AnimatedPath: | 579 case AnimatedPath: |
| 577 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); | 580 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); |
| 578 break; | 581 break; |
| 579 case AnimatedRect: | 582 case AnimatedRect: |
| 580 return RectSVGInterpolation::create(fromValue, toValue, attribute); | 583 return RectSVGInterpolation::create(fromValue, toValue, attribute); |
| 581 case AnimatedTransformList: | 584 case AnimatedTransformList: |
| 582 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); | 585 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); |
| 583 break; | 586 break; |
| 584 | 587 |
| 585 // Handled by SVGInterpolationTypes. | 588 // Handled by SVGInterpolationTypes. |
| 586 case AnimatedAngle: | 589 case AnimatedAngle: |
| 587 case AnimatedInteger: | 590 case AnimatedInteger: |
| 588 case AnimatedNumber: | 591 case AnimatedNumber: |
| 592 case AnimatedNumberOptionalNumber: |
| 589 case AnimatedPoints: | 593 case AnimatedPoints: |
| 590 ASSERT_NOT_REACHED(); | 594 ASSERT_NOT_REACHED(); |
| 591 // Fallthrough. | 595 // Fallthrough. |
| 592 | 596 |
| 593 // TODO(ericwilligers): Support more animation types. | 597 // TODO(ericwilligers): Support more animation types. |
| 594 default: | 598 default: |
| 595 break; | 599 break; |
| 596 } | 600 } |
| 597 if (interpolation) | 601 if (interpolation) |
| 598 return interpolation.release(); | 602 return interpolation.release(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 615 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 619 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
| 616 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 620 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
| 617 | 621 |
| 618 if (!fromValue || !toValue) | 622 if (!fromValue || !toValue) |
| 619 return nullptr; | 623 return nullptr; |
| 620 | 624 |
| 621 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 625 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
| 622 } | 626 } |
| 623 | 627 |
| 624 } // namespace blink | 628 } // namespace blink |
| OLD | NEW |