Title: [91187] trunk
Revision
91187
Author
[email protected]
Date
2011-07-18 09:16:17 -0700 (Mon, 18 Jul 2011)

Log Message

AnimationBase asserts if a test tries to pause during the delay phase
https://bugs.webkit.org/show_bug.cgi?id=59475

Patch by Young Han Lee <[email protected]> on 2011-07-18
Reviewed by Simon Fraser.

There is no more assertion failure after r90765, but the testcase still fails due to
the miscalculation of the pauseTime. This patch pauses the animation at its startTime
if a test tries to pause it during the delay phase.

Source/WebCore:

Test: transitions/transition-in-delay-phase.html

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::freezeAtTime):

LayoutTests:

* transitions/transition-in-delay-phase-expected.txt: Added.
* transitions/transition-in-delay-phase.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (91186 => 91187)


--- trunk/LayoutTests/ChangeLog	2011-07-18 14:26:19 UTC (rev 91186)
+++ trunk/LayoutTests/ChangeLog	2011-07-18 16:16:17 UTC (rev 91187)
@@ -1,3 +1,17 @@
+2011-07-18  Young Han Lee  <[email protected]>
+
+        AnimationBase asserts if a test tries to pause during the delay phase
+        https://bugs.webkit.org/show_bug.cgi?id=59475
+
+        Reviewed by Simon Fraser.
+
+        There is no more assertion failure after r90765, but the testcase still fails due to
+        the miscalculation of the pauseTime. This patch pauses the animation at its startTime
+        if a test tries to pause it during the delay phase.
+
+        * transitions/transition-in-delay-phase-expected.txt: Added.
+        * transitions/transition-in-delay-phase.html: Added.
+
 2011-07-18  Stephen White  <[email protected]>
 
         Unreviewed; updated chromium test expectations.

Added: trunk/LayoutTests/transitions/transition-in-delay-phase-expected.txt (0 => 91187)


--- trunk/LayoutTests/transitions/transition-in-delay-phase-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/transitions/transition-in-delay-phase-expected.txt	2011-07-18 16:16:17 UTC (rev 91187)
@@ -0,0 +1,6 @@
+Test for transition in delay phase
+
+This test works only in DumpRenderTree. It uses an API exposed only there to jump to a particular time in a running transition. Tests bug 59475
+
+PASS - "left" property for "target" element at 0.5s saw something close to: 100
+

Added: trunk/LayoutTests/transitions/transition-in-delay-phase.html (0 => 91187)


--- trunk/LayoutTests/transitions/transition-in-delay-phase.html	                        (rev 0)
+++ trunk/LayoutTests/transitions/transition-in-delay-phase.html	2011-07-18 16:16:17 UTC (rev 91187)
@@ -0,0 +1,44 @@
+<html>
+<head>
+  <style>
+    div {
+      position: relative;
+      left: 100px;
+      height: 50px;
+      width: 50px;
+      background-color: green;
+      -webkit-transition: left 4s linear 1s;
+    }
+    
+    .moved {
+      left: 200px;
+    }
+   </style>
+   <script src=""
+   <script>
+     const expectedValues = [
+       // [time, element-id, property, expected-value, tolerance]
+       [0.5, "target", "left", 100, 4],
+     ];
+
+     function setupTest()
+     {
+       document.getElementById("target").className = "moved";
+     }
+
+     runTransitionTest(expectedValues, setupTest, usePauseAPI);
+   </script>
+</head>
+<body>
+  <h1>Test for transition in delay phase</h1>
+
+  <p>This test works only in DumpRenderTree. It uses an API exposed
+    only there to jump to a particular time in a running transition.
+    Tests bug <a href=""
+  </p>
+
+  <div id="target"></div>
+  <div id="result"></div>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (91186 => 91187)


--- trunk/Source/WebCore/ChangeLog	2011-07-18 14:26:19 UTC (rev 91186)
+++ trunk/Source/WebCore/ChangeLog	2011-07-18 16:16:17 UTC (rev 91187)
@@ -1,3 +1,19 @@
+2011-07-18  Young Han Lee  <[email protected]>
+
+        AnimationBase asserts if a test tries to pause during the delay phase
+        https://bugs.webkit.org/show_bug.cgi?id=59475
+
+        Reviewed by Simon Fraser.
+
+        There is no more assertion failure after r90765, but the testcase still fails due to
+        the miscalculation of the pauseTime. This patch pauses the animation at its startTime
+        if a test tries to pause it during the delay phase.
+
+        Test: transitions/transition-in-delay-phase.html
+
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::freezeAtTime):
+
 2011-07-18  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Web Inspector: provide unique identifiers for loaders

Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (91186 => 91187)


--- trunk/Source/WebCore/page/animation/AnimationBase.cpp	2011-07-18 14:26:19 UTC (rev 91186)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp	2011-07-18 16:16:17 UTC (rev 91187)
@@ -1449,7 +1449,10 @@
     }
 
     ASSERT(m_startTime);        // if m_startTime is zero, we haven't started yet, so we'll get a bad pause time.
-    m_pauseTime = m_startTime + t - m_animation->delay();
+    if (t <= m_animation->delay())
+        m_pauseTime = m_startTime;
+    else
+        m_pauseTime = m_startTime + t - m_animation->delay();
 
 #if USE(ACCELERATED_COMPOSITING)
     if (m_object && m_object->hasLayer()) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to