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

Unified Diff: Source/core/animation/StringKeyframe.cpp

Issue 1068973004: Web Animations: Support animation of SVG number attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/NumberSVGInterpolation.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/StringKeyframe.cpp
diff --git a/Source/core/animation/StringKeyframe.cpp b/Source/core/animation/StringKeyframe.cpp
index 1c1e99e84a5edbfb878f7c9c9532141e6d821e38..8d5aa3d75aef29d88c0ef98474f6b4c6a793338b 100644
--- a/Source/core/animation/StringKeyframe.cpp
+++ b/Source/core/animation/StringKeyframe.cpp
@@ -21,6 +21,7 @@
#include "core/animation/LengthStyleInterpolation.h"
#include "core/animation/ListSVGInterpolation.h"
#include "core/animation/ListStyleInterpolation.h"
+#include "core/animation/NumberSVGInterpolation.h"
#include "core/animation/PointSVGInterpolation.h"
#include "core/animation/RectSVGInterpolation.h"
#include "core/animation/SVGStrokeDasharrayStyleInterpolation.h"
@@ -480,8 +481,17 @@ PassRefPtrWillBeRawPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fr
if (AngleSVGInterpolation::canCreateFrom(fromValue) && AngleSVGInterpolation::canCreateFrom(toValue))
return AngleSVGInterpolation::create(fromValue, toValue, attribute);
break;
- case AnimatedIntegerOptionalInteger:
- return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue, attribute);
+ case AnimatedIntegerOptionalInteger: {
+ int min = &attribute->attributeName() == &SVGNames::orderAttr ? 1 : 0;
+ return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue, attribute, min);
+ }
+ case AnimatedNumber: {
+ SVGNumberNegativeValuesMode negativeValuesMode = &attribute->attributeName() == &SVGNames::pathLengthAttr ? ForbidNegativeNumbers : AllowNegativeNumbers;
+ return NumberSVGInterpolation::create(fromValue, toValue, attribute, negativeValuesMode);
+ }
+ case AnimatedNumberList:
+ interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreate(fromValue, toValue, attribute);
+ break;
case AnimatedPoints:
interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate(fromValue, toValue, attribute);
break;
« no previous file with comments | « Source/core/animation/NumberSVGInterpolation.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698