Commit a44e2e7f authored by krit@webkit.org's avatar krit@webkit.org

2011-07-07 Dirk Schulze <krit@webkit.org>

        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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@90585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 80b8a8f5
2011-07-07 Dirk Schulze <krit@webkit.org>
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 <krit@webkit.org>
Reviewed by Rob Buis.
......
<svg xmlns="http://www.w3.org/2000/svg">
<text x="10" y="20">Testing calcMode="discrete" for &lt;animateTransform&gt;. The rect should jump by 100px at 2s.</text>
<rect y="30" width="100px" height="100px" fill="green">
<animateTransform attributeName="transform" type="translate" from="0,0" to="100,0" calcMode="discrete" fill="freeze" dur="4s"/>
</rect>
</svg>
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment