2007-01-27 Eric Seidel <eric@webkit.org>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Jan 2007 11:24:55 +0000 (11:24 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Jan 2007 11:24:55 +0000 (11:24 +0000)
        Reviewed by olliej.

        Fix support for SVG's <set> element.

        Manual test added.

        * ksvg2/svg/SVGSetElement.cpp:
        (WebCore::SVGSetElement::updateAnimatedValue):
        (WebCore::SVGSetElement::calculateFromAndToValues):
        * ksvg2/svg/SVGSetElement.h:
        * manual-tests/animation/set-to.svg: Added.

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

WebCore/ChangeLog
WebCore/ksvg2/svg/SVGSetElement.cpp
WebCore/ksvg2/svg/SVGSetElement.h
WebCore/manual-tests/animation/set-to.svg [new file with mode: 0644]

index 9902837..f8191c1 100644 (file)
@@ -1,3 +1,17 @@
+2007-01-27  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by olliej.
+
+        Fix support for SVG's <set> element.
+
+        Manual test added.
+
+        * ksvg2/svg/SVGSetElement.cpp:
+        (WebCore::SVGSetElement::updateAnimatedValue):
+        (WebCore::SVGSetElement::calculateFromAndToValues):
+        * ksvg2/svg/SVGSetElement.h:
+        * manual-tests/animation/set-to.svg: Added.
+
 2007-01-27  Alexey Proskuryakov  <ap@webkit.org>
 
         Release build fix.
index f4061b7..fa6989a 100644 (file)
@@ -39,6 +39,17 @@ SVGSetElement::~SVGSetElement()
 {
 }
 
+bool SVGSetElement::updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast)
+{
+    m_animatedValue = m_to;
+    return true;
+}
+
+bool SVGSetElement::calculateFromAndToValues(EAnimationMode, unsigned valueIndex)
+{
+    return true;
+}
+
 }
 
 // vim:ts=4:noet
index a43a606..f59ae53 100644 (file)
@@ -37,8 +37,8 @@ namespace WebCore
     protected:
         virtual const SVGElement* contextElement() const { return this; }
         
-        virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast) { return true; }
-        virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex) { return true; }
+        virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast);
+        virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex);
 
     private:
         String m_savedTo;
diff --git a/WebCore/manual-tests/animation/set-to.svg b/WebCore/manual-tests/animation/set-to.svg
new file mode 100644 (file)
index 0000000..8b35459
--- /dev/null
@@ -0,0 +1,10 @@
+<svg xmlns='http://www.w3.org/2000/svg'>
+  <rect width='100' height='100' fill='red' />
+  <rect x='-100' width='100' height='100' fill='red'>
+    <set attributeName='x' to='0' dur='3s' />
+    <set attributeName='fill' to='green' dur='3s' />
+  </rect>
+  <text x='10' y='120'>
+    There should be a 100x100 green rect at 0,0.
+  </text>  
+</svg>