Diff
Modified: trunk/LayoutTests/ChangeLog (88640 => 88641)
--- trunk/LayoutTests/ChangeLog 2011-06-13 15:28:56 UTC (rev 88640)
+++ trunk/LayoutTests/ChangeLog 2011-06-13 15:36:13 UTC (rev 88641)
@@ -1,3 +1,16 @@
+2011-06-13 Young Han Lee <[email protected]>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap][Qt] Accelerated animation is repeating as if its direction property is always 'alternate'.
+ https://bugs.webkit.org/show_bug.cgi?id=62281
+
+ syncAnimations() has miscalculated a normalized progress value as if the animation always has alternate direction property.
+
+ * animations/animation-direction-normal-expected.png: Added.
+ * animations/animation-direction-normal-expected.txt: Added.
+ * animations/animation-direction-normal.html: Added.
+
2011-06-13 Dirk Schulze <[email protected]>
Reviewed by Rob Buis.
Added: trunk/LayoutTests/animations/animation-direction-normal-expected.png (0 => 88641)
--- trunk/LayoutTests/animations/animation-direction-normal-expected.png (rev 0)
+++ trunk/LayoutTests/animations/animation-direction-normal-expected.png 2011-06-13 15:36:13 UTC (rev 88641)
@@ -0,0 +1,4 @@
+\x89PNG
+
+
+IHDR X \x9Av\x82p sBIT|d\x88 pHYs \xC4 \xC4\x95+ )tEXtchecksum d3fe90af437a7dc5e41751cfcc7d1451\x9BE(\x86 \x80IDATx\x9C\xED\xD9\xC1 \xC3P\xC1\xFC\x90\xBE\x8D+\x97\xBBX<Ӏ\xDEuљ\x99\xF9 \xBE\xDB \x80\xF7 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 \x99\xDF\xD6\xE1s\x9F\xAD\xD3\xE6\x9A\xED \xFC! #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2 \xC8 #@ \x80\x8C 2gff{ \xF0> @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d \x90 @F\x80 d\xE7\x9D\xA91B8\xFE IEND\xAEB`\x82
\ No newline at end of file
Added: trunk/LayoutTests/animations/animation-direction-normal-expected.txt (0 => 88641)
--- trunk/LayoutTests/animations/animation-direction-normal-expected.txt (rev 0)
+++ trunk/LayoutTests/animations/animation-direction-normal-expected.txt 2011-06-13 15:36:13 UTC (rev 88641)
@@ -0,0 +1,4 @@
+PASS - "webkitTransform" property for "box" element at 0.5s saw something close to: 1,0,0,1,50,0
+PASS - "webkitTransform" property for "box" element at 1s saw something close to: 1,0,0,1,100,0
+PASS - "webkitTransform" property for "box" element at 2.5s saw something close to: 1,0,0,1,50,0
+
Added: trunk/LayoutTests/animations/animation-direction-normal.html (0 => 88641)
--- trunk/LayoutTests/animations/animation-direction-normal.html (rev 0)
+++ trunk/LayoutTests/animations/animation-direction-normal.html 2011-06-13 15:36:13 UTC (rev 88641)
@@ -0,0 +1,70 @@
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Test of -webkit-animation-play-state</title>
+ <style type="text/css" media="screen">
+ body {
+ margin: 0;
+ }
+
+ #box {
+ position: absolute;
+ left: 0px;
+ top: 100px;
+ height: 100px;
+ width: 100px;
+ background-color: red;
+ margin: 0;
+ -webkit-animation-duration: 2s;
+ -webkit-animation-direction: normal;
+ -webkit-animation-iteration-count: 2;
+ -webkit-animation-timing-function: linear;
+ -webkit-animation-name: "move1";
+ }
+ #safezone {
+ position: absolute;
+ top: 100px;
+ height: 100px;
+ width: 120px;
+ left: 30px;
+ background-color: green;
+ }
+ @-webkit-keyframes "move1" {
+ from { -webkit-transform: translateX(0px); }
+ to { -webkit-transform: translateX(200px); }
+ }
+ #result {
+ color: white; /* hide from pixel results */
+ }
+ </style>
+ <script src="" type="text/_javascript_" charset="utf-8"></script>
+ <script type="text/_javascript_" charset="utf-8">
+ const expectedValues = [
+ // [animation-name, time, element-id, property, expected-value, tolerance]
+ ["move1", 0.5, "box", "webkitTransform", [1,0,0,1, 50,0], 20],
+ ["move1", 1.0, "box", "webkitTransform", [1,0,0,1,100,0], 20],
+ ["move1", 2.5, "box", "webkitTransform", [1,0,0,1, 50,0], 20],
+ ];
+
+ function pauseAnimation()
+ {
+ document.getElementById("box").style.webkitAnimationPlayState = "paused";
+ }
+
+ function setTimers()
+ {
+ setTimeout(pauseAnimation, 2500);
+ }
+
+ runAnimationTest(expectedValues, setTimers, null, true);
+
+ </script>
+</head>
+<body>
+<!-- This tests the operation of -webkit-animation-play-state. After 1 second the red boxes should be hidden by the green boxes. You should see no red boxes. -->
+<div id="box"></div>
+<div id="safezone"></div>
+<div id="result"></div>
+</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (88640 => 88641)
--- trunk/Source/WebCore/ChangeLog 2011-06-13 15:28:56 UTC (rev 88640)
+++ trunk/Source/WebCore/ChangeLog 2011-06-13 15:36:13 UTC (rev 88641)
@@ -1,3 +1,17 @@
+2011-06-13 Young Han Lee <[email protected]>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap][Qt] Accelerated animation is repeating as if its direction property is always 'alternate'.
+ https://bugs.webkit.org/show_bug.cgi?id=62281
+
+ syncAnimations() has miscalculated a normalized progress value as if the animation always has alternate direction property.
+
+ Test: animations/animation-direction-normal.html
+
+ * platform/graphics/texmap/TextureMapperNode.cpp:
+ (WebCore::TextureMapperNode::syncAnimations):
+
2011-06-13 Dirk Schulze <[email protected]>
Reviewed by Rob Buis.
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp (88640 => 88641)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp 2011-06-13 15:28:56 UTC (rev 88640)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp 2011-06-13 15:36:13 UTC (rev 88641)
@@ -842,7 +842,7 @@
double totalRunningTime = WTF::currentTime() - animation->startTime;
RefPtr<Animation> anim = animation->animation;
- double normalizedValue = normalizedAnimationValue(totalRunningTime, anim->duration(), true);
+ double normalizedValue = normalizedAnimationValue(totalRunningTime, anim->duration(), anim->direction());
if (anim->iterationCount() != Animation::IterationCountInfinite && totalRunningTime >= anim->duration() * anim->iterationCount()) {
// We apply an animation that very close to the edge, so that the final frame is applied, oterwise we might get, for example, an opacity of 0.01 which is still visible.