<animateTransform type="scale"> should use '0' as effective from value not '1', if...
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Apr 2012 12:01:48 +0000 (12:01 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Apr 2012 12:01:48 +0000 (12:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85133

Source/WebCore:

It should start from scale=0. I had that fixed before, but it got lost during merging. Restore the fix.
See bug 85051, for more context why this is correct.

Tests: svg/animations/animateTransform-by-scale-1-expected.svg
       svg/animations/animateTransform-by-scale-1.svg

* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):

LayoutTests:

Reviewed by Antti Koivisto.

* svg/animations/animateTransform-by-scale-1-expected.svg: Added.
* svg/animations/animateTransform-by-scale-1.svg: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/svg/animations/animateTransform-by-scale-1-expected.svg [new file with mode: 0644]
LayoutTests/svg/animations/animateTransform-by-scale-1.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGAnimatedTransformList.cpp

index c627555..eab7912 100644 (file)
@@ -1,3 +1,13 @@
+2012-04-28  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        <animateTransform type="scale"> should use '0' as effective from value not '1', if no base value is specified and from is not given
+        https://bugs.webkit.org/show_bug.cgi?id=85133
+
+        Reviewed by Antti Koivisto.
+
+        * svg/animations/animateTransform-by-scale-1-expected.svg: Added.
+        * svg/animations/animateTransform-by-scale-1.svg: Added.
+
 2012-04-28  Noel Gordon  <noel.gordon@gmail.com>
 
         [chromium] http/tests/websocket/tests/hixie76/url-parsing.html is failing
diff --git a/LayoutTests/svg/animations/animateTransform-by-scale-1-expected.svg b/LayoutTests/svg/animations/animateTransform-by-scale-1-expected.svg
new file mode 100644 (file)
index 0000000..bdb3dce
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<circle cx="150" cy="150" r="100" fill="green" transform="scale(0.1 0.1)"/>
+</svg>
diff --git a/LayoutTests/svg/animations/animateTransform-by-scale-1.svg b/LayoutTests/svg/animations/animateTransform-by-scale-1.svg
new file mode 100644 (file)
index 0000000..89a2454
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<svg onload="loaded()" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<circle cx="150" cy="150" r="100" fill="green">
+    <animateTransform attributeName="transform" type="scale" by="0.2" begin="0s" dur="2s" fill="freeze"/>
+</circle>
+
+<script>
+if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+function loaded() {
+    document.documentElement.setCurrentTime(1);
+    document.documentElement.pauseAnimations();
+
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+</script>
+</svg>
index b14d9e9..010ed5c 100644 (file)
@@ -1,5 +1,19 @@
 2012-04-28  Nikolas Zimmermann  <nzimmermann@rim.com>
 
+        <animateTransform type="scale"> should use '0' as effective from value not '1', if no base value is specified and from is not given
+        https://bugs.webkit.org/show_bug.cgi?id=85133
+
+        It should start from scale=0. I had that fixed before, but it got lost during merging. Restore the fix.
+        See bug 85051, for more context why this is correct.
+
+        Tests: svg/animations/animateTransform-by-scale-1-expected.svg
+               svg/animations/animateTransform-by-scale-1.svg
+
+        * svg/SVGAnimatedTransformList.cpp:
+        (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
+
+2012-04-28  Nikolas Zimmermann  <nzimmermann@rim.com>
+
         SVGAnimateColorElement doesn't support by/to animations properly
         https://bugs.webkit.org/show_bug.cgi?id=36704
 
index cdecb7b..ec8d9a6 100644 (file)
@@ -115,7 +115,7 @@ void SVGAnimatedTransformListAnimator::calculateAnimatedValue(float percentage,
 
     unsigned fromTransformListSize = fromTransformList.size();
     SVGTransform& toTransform = toTransformList[0];
-    SVGTransform effectiveFrom = fromTransformListSize ? fromTransformList[0] : SVGTransform(toTransform.type());
+    SVGTransform effectiveFrom = fromTransformListSize ? fromTransformList[0] : SVGTransform(toTransform.type(), SVGTransform::ConstructZeroTransform);
     SVGTransform currentTransform = SVGTransformDistance(effectiveFrom, toTransform).scaledDistance(percentage).addToSVGTransform(effectiveFrom);
     if (m_animationElement->isAccumulated() && repeatCount)
         animatedTransformList.append(SVGTransformDistance::addSVGTransforms(currentTransform, toTransform, repeatCount));