Title: [88234] trunk
Revision
88234
Author
[email protected]
Date
2011-06-07 06:31:51 -0700 (Tue, 07 Jun 2011)

Log Message

2011-06-07  Felician Marton  <[email protected]>

        Reviewed by Nikolas Zimmermann.

        SVG animation beginElement() does not restart the animation after endElement().
        https://bugs.webkit.org/show_bug.cgi?id=43452

        Added test for animation beginElement. It should restart the animation even if the animation is stopped by endElement() previously.

        * svg/animations/animate-endElement-beginElement-expected.txt: Added.
        * svg/animations/animate-endElement-beginElement.html: Added.
        * svg/animations/script-tests/animate-endElement-beginElement.js: Added.
2011-06-07  Felician Marton  <[email protected]>

        Reviewed by Nikolas Zimmermann.

        SVG animation beginElement() does not restart the animation after endElement().
        https://bugs.webkit.org/show_bug.cgi?id=43452

        Test: svg/animations/animate-endElement-beginElement.html

        Calling beginElement() after calling endElement() previously does not restarted the animation when animation
        element's end attribute doesn't contains a bigger value than the current animation time.

        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::findInstanceTime):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88233 => 88234)


--- trunk/LayoutTests/ChangeLog	2011-06-07 13:22:31 UTC (rev 88233)
+++ trunk/LayoutTests/ChangeLog	2011-06-07 13:31:51 UTC (rev 88234)
@@ -1,3 +1,16 @@
+2011-06-07  Felician Marton  <[email protected]>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG animation beginElement() does not restart the animation after endElement().
+        https://bugs.webkit.org/show_bug.cgi?id=43452
+
+        Added test for animation beginElement. It should restart the animation even if the animation is stopped by endElement() previously.
+
+        * svg/animations/animate-endElement-beginElement-expected.txt: Added.
+        * svg/animations/animate-endElement-beginElement.html: Added.
+        * svg/animations/script-tests/animate-endElement-beginElement.js: Added.
+
 2011-06-07  MORITA Hajime <[email protected]>
 
         Unreviewed Skipped entry addition following r88225.

Added: trunk/LayoutTests/svg/animations/animate-endElement-beginElement-expected.txt (0 => 88234)


--- trunk/LayoutTests/svg/animations/animate-endElement-beginElement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-endElement-beginElement-expected.txt	2011-06-07 13:31:51 UTC (rev 88234)
@@ -0,0 +1,12 @@
+SVG 1.1 dynamic animation tests
+
+Tests animation beginElement command's restarting capability after endElement.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS rect.x.animVal.value is 50
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/svg/animations/animate-endElement-beginElement.html (0 => 88234)


--- trunk/LayoutTests/svg/animations/animate-endElement-beginElement.html	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-endElement-beginElement.html	2011-06-07 13:31:51 UTC (rev 88234)
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<h1>SVG 1.1 dynamic animation tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/svg/animations/script-tests/animate-endElement-beginElement.js (0 => 88234)


--- trunk/LayoutTests/svg/animations/script-tests/animate-endElement-beginElement.js	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/script-tests/animate-endElement-beginElement.js	2011-06-07 13:31:51 UTC (rev 88234)
@@ -0,0 +1,59 @@
+description("Tests animation beginElement command's restarting capability after endElement.");
+createSVGTestCase();
+
+// Setup test document
+
+var rect = createSVGElement("rect");
+rect.setAttribute("id", "rect");
+rect.setAttribute("width", "50px");
+rect.setAttribute("height", "50px");
+rect.setAttribute("fill", "green");
+
+var animateX = createSVGElement("animate");
+animateX.setAttribute("id", "animateX");
+animateX.setAttribute("attributeName", "x");
+animateX.setAttribute("from", "0");
+animateX.setAttribute("to", "100");
+animateX.setAttribute("dur", "2s");
+animateX.setAttribute("begin", "indefinite");
+animateX.setAttribute("fill", "freeze");
+rect.appendChild(animateX);
+rootSVGElement.appendChild(rect);
+
+// Setup animation test
+
+function sample1() {
+    // Check half-time conditions
+    shouldBe("rect.x.animVal.value", "50");
+}
+
+function startRestart() {
+    animateX.beginElement();
+    setTimeout(end,0);
+}
+
+function end() {
+    animateX.endElement();
+    setTimeout(begin,0);
+}
+
+function begin() {
+    animateX.beginElement();      
+    const expectedValues = [
+        // [animationId, time, elementId, sampleCallback]
+        ["animateX", 1.0, "rect", sample1]
+    ];
+    runAnimationTest(expectedValues);
+}
+
+function executeTest() {
+    //BeginElement-endElement-beginElement musn't execute in zero time, because in the current
+    //implemetation of the svg animation will loose the commands order!
+    startRestart();        
+}
+
+// Begin test async
+rect.setAttribute("onclick", "executeTest()");
+window.setTimeout("triggerUpdate(50, 50)", 0);
+var successfullyParsed = true;
+

Modified: trunk/Source/WebCore/ChangeLog (88233 => 88234)


--- trunk/Source/WebCore/ChangeLog	2011-06-07 13:22:31 UTC (rev 88233)
+++ trunk/Source/WebCore/ChangeLog	2011-06-07 13:31:51 UTC (rev 88234)
@@ -1,3 +1,18 @@
+2011-06-07  Felician Marton  <[email protected]>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG animation beginElement() does not restart the animation after endElement().
+        https://bugs.webkit.org/show_bug.cgi?id=43452
+
+        Test: svg/animations/animate-endElement-beginElement.html
+
+        Calling beginElement() after calling endElement() previously does not restarted the animation when animation
+        element's end attribute doesn't contains a bigger value than the current animation time.
+
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::findInstanceTime):
+
 2011-06-07  Naoki Takano  <[email protected]>
 
         Reviewed by Kent Tamura.

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (88233 => 88234)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2011-06-07 13:22:31 UTC (rev 88233)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2011-06-07 13:31:51 UTC (rev 88234)
@@ -634,7 +634,7 @@
         } else if (time > minimumTime)
             return time;
     }
-    return SMILTime::unresolved();
+    return beginOrEnd == Begin ? SMILTime::unresolved() : SMILTime::indefinite();
 }
 
 SMILTime SVGSMILElement::repeatingDuration() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to