Title: [90585] trunk/Source/WebCore
Revision
90585
Author
[email protected]
Date
2011-07-07 13:17:00 -0700 (Thu, 07 Jul 2011)

Log Message

2011-07-07  Dirk Schulze  <[email protected]>

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

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (90584 => 90585)


--- trunk/Source/WebCore/ChangeLog	2011-07-07 19:13:46 UTC (rev 90584)
+++ trunk/Source/WebCore/ChangeLog	2011-07-07 20:17:00 UTC (rev 90585)
@@ -1,7 +1,25 @@
 2011-07-07  Dirk Schulze  <[email protected]>
 
+        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  <[email protected]>
+
+        Reviewed by Rob Buis.
+
         SVGAnimatedPath needs fallback for 'by' animation
         https://bugs.webkit.org/show_bug.cgi?id=63865
         

Added: trunk/Source/WebCore/manual-tests/svg-animateTransform-calcMode-discrete.svg (0 => 90585)


--- trunk/Source/WebCore/manual-tests/svg-animateTransform-calcMode-discrete.svg	                        (rev 0)
+++ trunk/Source/WebCore/manual-tests/svg-animateTransform-calcMode-discrete.svg	2011-07-07 20:17:00 UTC (rev 90585)
@@ -0,0 +1,6 @@
+<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>

Modified: trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp (90584 => 90585)


--- trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp	2011-07-07 19:13:46 UTC (rev 90584)
+++ trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp	2011-07-07 20:17:00 UTC (rev 90585)
@@ -158,6 +158,9 @@
         return;
     SVGTransformList* transformList = transformListFor(targetElement);
     ASSERT(transformList);
+    
+    if (calcMode() == CalcModeDiscrete)
+        percentage = percentage < 0.5 ? 0 : 1;
 
     if (!isAdditive())
         transformList->clear();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to