Title: [89774] trunk
Revision
89774
Author
[email protected]
Date
2011-06-26 14:26:29 -0700 (Sun, 26 Jun 2011)

Log Message

2011-06-26  Young Han Lee  <[email protected]>

        Reviewed by Dirk Schulze.

        SVGAnimation - keyTime value 1 never get animated
        https://bugs.webkit.org/show_bug.cgi?id=63230

        According to the SMIL 3.0 specification, the index of the keyTimes should be
        determined under the end-point-exclusive rule (e.g. Given keyTimes(0;0.5;1)
        and t=0.5, the current index of the keyTimes have to be 1 not 0).
        http://www.w3.org/TR/SMIL3/smil-animation.html#animationNS-InterpolationExamplesAdvanced

        * svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt: Added.
        * svg/animations/animate-number-calcMode-discrete-keyTimes.html: Added.
        * svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js: Added.
        (sample1):
        (sample2):
        (sample3):
        (executeTest):
2011-06-26  Young Han Lee  <[email protected]>

        Reviewed by Dirk Schulze.

        SVGAnimation - keyTime value 1 never get animated
        https://bugs.webkit.org/show_bug.cgi?id=63230

        According to the SMIL 3.0 specification, the index of the keyTimes should be
        determined under the end-point-exclusive rule (e.g. Given keyTimes(0;0.5;1)
        and t=0.5, the current index of the keyTimes have to be 1 not 0).
        http://www.w3.org/TR/SMIL3/smil-animation.html#animationNS-InterpolationExamplesAdvanced

        Test: svg/animations/animate-number-calcMode-discrete-keyTimes.html

        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::calculateKeyTimesIndex):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89773 => 89774)


--- trunk/LayoutTests/ChangeLog	2011-06-26 20:21:01 UTC (rev 89773)
+++ trunk/LayoutTests/ChangeLog	2011-06-26 21:26:29 UTC (rev 89774)
@@ -1,3 +1,23 @@
+2011-06-26  Young Han Lee  <[email protected]>
+
+        Reviewed by Dirk Schulze.
+
+        SVGAnimation - keyTime value 1 never get animated
+        https://bugs.webkit.org/show_bug.cgi?id=63230
+
+        According to the SMIL 3.0 specification, the index of the keyTimes should be 
+        determined under the end-point-exclusive rule (e.g. Given keyTimes(0;0.5;1) 
+        and t=0.5, the current index of the keyTimes have to be 1 not 0).
+        http://www.w3.org/TR/SMIL3/smil-animation.html#animationNS-InterpolationExamplesAdvanced
+
+        * svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt: Added.
+        * svg/animations/animate-number-calcMode-discrete-keyTimes.html: Added.
+        * svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js: Added.
+        (sample1):
+        (sample2):
+        (sample3):
+        (executeTest):
+
 2011-06-26  Adam Barth  <[email protected]>
 
         Darn.  Need BUGWG to make the file parse.

Added: trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt (0 => 89774)


--- trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt	2011-06-26 21:26:29 UTC (rev 89774)
@@ -0,0 +1,7 @@
+PASS rect.x.baseVal.value is 100
+PASS rect.x.baseVal.value is 200
+PASS rect.x.baseVal.value is 300
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes.html (0 => 89774)


--- trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes.html	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes.html	2011-06-26 21:26:29 UTC (rev 89774)
@@ -0,0 +1,11 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="console"></div>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js (0 => 89774)


--- trunk/LayoutTests/svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js	                        (rev 0)
+++ trunk/LayoutTests/svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js	2011-06-26 21:26:29 UTC (rev 89774)
@@ -0,0 +1,50 @@
+createSVGTestCase();
+
+// Setup test document
+var rect = createSVGElement("rect");
+rect.setAttribute("id", "rect");
+rect.setAttribute("x", "100");
+rect.setAttribute("width", "100");
+rect.setAttribute("height", "100");
+rect.setAttribute("fill", "green");
+rect.setAttribute("onclick", "executeTest()");
+
+var animate = createSVGElement("animate");
+animate.setAttribute("id", "animation");
+animate.setAttribute("attributeName", "x");
+animate.setAttribute("values", "100;200;300");
+animate.setAttribute("begin", "click");
+animate.setAttribute("dur", "3s");
+animate.setAttribute("keyTimes", "0;0.5;1");
+animate.setAttribute("calcMode", "discrete");
+animate.setAttribute("fill", "freeze");
+rect.appendChild(animate);
+rootSVGElement.appendChild(rect);
+
+// Setup animation test
+function sample1() {
+    shouldBe("rect.x.baseVal.value", "100");
+}
+
+function sample2() {
+    shouldBe("rect.x.baseVal.value", "200");
+}
+
+function sample3() {
+    shouldBe("rect.x.baseVal.value", "300");
+}
+
+function executeTest() {
+    const expectedValues = [
+        // [animationId, time, elementId, sampleCallback]
+        ["animation", 1.0,    "rect", sample1],
+        ["animation", 1.5,    "rect", sample2],
+        ["animation", 3.0,    "rect", sample3]
+    ];
+
+    runAnimationTest(expectedValues);
+}
+
+// Begin test async
+window.setTimeout("triggerUpdate(150, 30)", 0);
+var successfullyParsed = true;

Modified: trunk/Source/WebCore/ChangeLog (89773 => 89774)


--- trunk/Source/WebCore/ChangeLog	2011-06-26 20:21:01 UTC (rev 89773)
+++ trunk/Source/WebCore/ChangeLog	2011-06-26 21:26:29 UTC (rev 89774)
@@ -1,3 +1,20 @@
+2011-06-26  Young Han Lee  <[email protected]>
+
+        Reviewed by Dirk Schulze.
+
+        SVGAnimation - keyTime value 1 never get animated
+        https://bugs.webkit.org/show_bug.cgi?id=63230
+
+        According to the SMIL 3.0 specification, the index of the keyTimes should be 
+        determined under the end-point-exclusive rule (e.g. Given keyTimes(0;0.5;1) 
+        and t=0.5, the current index of the keyTimes have to be 1 not 0).
+        http://www.w3.org/TR/SMIL3/smil-animation.html#animationNS-InterpolationExamplesAdvanced
+
+        Test: svg/animations/animate-number-calcMode-discrete-keyTimes.html
+
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::calculateKeyTimesIndex):
+
 2011-06-26  Dan Bernstein  <[email protected]>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (89773 => 89774)


--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp	2011-06-26 20:21:01 UTC (rev 89773)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp	2011-06-26 21:26:29 UTC (rev 89774)
@@ -422,7 +422,7 @@
     unsigned index;
     unsigned keyTimesCount = m_keyTimes.size();
     for (index = 1; index < keyTimesCount; ++index) {
-        if (m_keyTimes[index] >= percent)
+        if (m_keyTimes[index] > percent)
             break;
     }
     return --index;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to