Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/Source/core/animation/StringKeyframe.cpp

Issue 1410343009: [WIP] Web Animations: Migrate SVG number list interpolation to interpolation types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 21 matching lines...) Expand all
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" 40 #include "core/animation/RectSVGInterpolation.h"
41 #include "core/animation/SVGNumberInterpolationType.h" 41 #include "core/animation/SVGNumberInterpolationType.h"
42 #include "core/animation/SVGNumberListInterpolationType.h"
42 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" 43 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h"
43 #include "core/animation/SVGValueInterpolationType.h" 44 #include "core/animation/SVGValueInterpolationType.h"
44 #include "core/animation/TransformSVGInterpolation.h" 45 #include "core/animation/TransformSVGInterpolation.h"
45 #include "core/animation/VisibilityStyleInterpolation.h" 46 #include "core/animation/VisibilityStyleInterpolation.h"
46 #include "core/animation/css/CSSAnimations.h" 47 #include "core/animation/css/CSSAnimations.h"
47 #include "core/css/CSSPropertyMetadata.h" 48 #include "core/css/CSSPropertyMetadata.h"
48 #include "core/css/resolver/StyleResolver.h" 49 #include "core/css/resolver/StyleResolver.h"
49 #include "core/style/ComputedStyle.h" 50 #include "core/style/ComputedStyle.h"
50 #include "core/svg/SVGElement.h" 51 #include "core/svg/SVGElement.h"
51 #include "platform/RuntimeEnabledFeatures.h" 52 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 || attribute == SVGNames::resultAttr 312 || attribute == SVGNames::resultAttr
312 || attribute == SVGNames::spacingAttr 313 || attribute == SVGNames::spacingAttr
313 || attribute == SVGNames::spreadMethodAttr 314 || attribute == SVGNames::spreadMethodAttr
314 || attribute == SVGNames::stitchTilesAttr 315 || attribute == SVGNames::stitchTilesAttr
315 || attribute == SVGNames::targetAttr 316 || attribute == SVGNames::targetAttr
316 || attribute == SVGNames::typeAttr 317 || attribute == SVGNames::typeAttr
317 || attribute == SVGNames::xChannelSelectorAttr 318 || attribute == SVGNames::xChannelSelectorAttr
318 || attribute == SVGNames::yChannelSelectorAttr 319 || attribute == SVGNames::yChannelSelectorAttr
319 || attribute == XLinkNames::hrefAttr) { 320 || attribute == XLinkNames::hrefAttr) {
320 // Use default SVGValueInterpolationType. 321 // Use default SVGValueInterpolationType.
322 applicableTypes->append(new SVGValueInterpolationType(attribute));
323 } else if (attribute == SVGNames::kernelMatrixAttr
324 || attribute == SVGNames::rotateAttr
325 || attribute == SVGNames::tableValuesAttr
326 || attribute == SVGNames::valuesAttr) {
327 applicableTypes->append(new SVGNumberListInterpolationType(attribute ));
321 } else { 328 } else {
322 fallbackToLegacy = true; 329 fallbackToLegacy = true;
323 } 330 }
324 331
325 if (!fallbackToLegacy) 332 if (!fallbackToLegacy)
326 applicableTypes->append(new SVGValueInterpolationType(attribute)); 333 applicableTypes->append(new SVGValueInterpolationType(attribute));
327 } 334 }
328 335
329 if (fallbackToLegacy) { 336 if (fallbackToLegacy) {
330 delete applicableTypes; 337 delete applicableTypes;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue , attribute, min); 572 return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue , attribute, min);
566 } 573 }
567 case AnimatedLength: 574 case AnimatedLength:
568 return LengthSVGInterpolation::create(fromValue, toValue, attribute); 575 return LengthSVGInterpolation::create(fromValue, toValue, attribute);
569 case AnimatedLengthList: 576 case AnimatedLengthList:
570 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat e(fromValue, toValue, attribute); 577 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat e(fromValue, toValue, attribute);
571 break; 578 break;
572 case AnimatedNumberOptionalNumber: 579 case AnimatedNumberOptionalNumber:
573 return NumberOptionalNumberSVGInterpolation::create(fromValue, toValue, attribute); 580 return NumberOptionalNumberSVGInterpolation::create(fromValue, toValue, attribute);
574 case AnimatedNumberList: 581 case AnimatedNumberList:
575 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat e(fromValue, toValue, attribute); 582 ASSERT_NOT_REACHED();
576 break; 583 return nullptr;
577 case AnimatedPath: 584 case AnimatedPath:
578 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at tribute); 585 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at tribute);
579 break; 586 break;
580 case AnimatedPoints: 587 case AnimatedPoints:
581 interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate (fromValue, toValue, attribute); 588 interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate (fromValue, toValue, attribute);
582 break; 589 break;
583 case AnimatedRect: 590 case AnimatedRect:
584 return RectSVGInterpolation::create(fromValue, toValue, attribute); 591 return RectSVGInterpolation::create(fromValue, toValue, attribute);
585 case AnimatedTransformList: 592 case AnimatedTransformList:
586 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr eate(fromValue, toValue, attribute); 593 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr eate(fromValue, toValue, attribute);
(...skipping 29 matching lines...) Expand all
616 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase( )->cloneForAnimation(m_value); 623 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase( )->cloneForAnimation(m_value);
617 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()- >cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); 624 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()- >cloneForAnimation(toSVGPropertySpecificKeyframe(end).value());
618 625
619 if (!fromValue || !toValue) 626 if (!fromValue || !toValue)
620 return nullptr; 627 return nullptr;
621 628
622 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get( )); 629 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get( ));
623 } 630 }
624 631
625 } // namespace blink 632 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/SVGNumberListInterpolationType.cpp ('k') | third_party/WebKit/Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698