diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 0fa873efcc7dbdcffd96833215531e35b8a51d78..ad88aa5552c7a0fb0aaa2b919e2e6fb69dd46b11 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,21 @@ +2011-07-07 Dirk Schulze + + SVGAnimateTransform does not support calcMode=discrete + https://bugs.webkit.org/show_bug.cgi?id=63914 + + Reviewed by Rob Buis. + + CalcMode discrete specifies that the animation function will jump from one value to the next without any interpolation. + Implemented calcMode discrete by checking current progress of animation. If we are in the first half of the animation, + we use the start value of the aniamtion, end value for the second half of the animation. The key time at 50% is used on + all other animations as well as on other SVG viewers. + + Added a manual test. DRT crashes on an automated test with the SVG animation API. Opened a new bug report: 64104. + + * manual-tests/svg-animateTransform-calcMode-discrete.svg: Added. + * svg/SVGAnimateTransformElement.cpp: + (WebCore::SVGAnimateTransformElement::calculateAnimatedValue): + 2011-07-07 Dirk Schulze Reviewed by Rob Buis. diff --git a/Source/WebCore/manual-tests/svg-animateTransform-calcMode-discrete.svg b/Source/WebCore/manual-tests/svg-animateTransform-calcMode-discrete.svg new file mode 100644 index 0000000000000000000000000000000000000000..f9abef8e3240236be28f54379500547975d61d80 --- /dev/null +++ b/Source/WebCore/manual-tests/svg-animateTransform-calcMode-discrete.svg @@ -0,0 +1,6 @@ + +Testing calcMode="discrete" for <animateTransform>. The rect should jump by 100px at 2s. + + + + diff --git a/Source/WebCore/svg/SVGAnimateTransformElement.cpp b/Source/WebCore/svg/SVGAnimateTransformElement.cpp index 1cfb48b91bb05d3fda33344ea877fe7a89c90a4a..2cdefca9abfa90575bee69846e64aa8f0d997276 100644 --- a/Source/WebCore/svg/SVGAnimateTransformElement.cpp +++ b/Source/WebCore/svg/SVGAnimateTransformElement.cpp @@ -158,6 +158,9 @@ void SVGAnimateTransformElement::calculateAnimatedValue(float percentage, unsign return; SVGTransformList* transformList = transformListFor(targetElement); ASSERT(transformList); + + if (calcMode() == CalcModeDiscrete) + percentage = percentage < 0.5 ? 0 : 1; if (!isAdditive()) transformList->clear();