[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

cmarrin at apple.com cmarrin at apple.com
Wed Dec 22 11:24:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit da6eaf6bf18abd06212502fe2eee97b89df78ed3
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 21 23:16:19 2010 +0000

    2010-07-21  Chris Marrin  <cmarrin at apple.com>
    
            Reviewed by Simon Fraser.
    
            Assertion failure in AnimationBase::updateStateMachine() coming out of paused state
            https://bugs.webkit.org/show_bug.cgi?id=37993
    
            Added logic to properly handle pausing and resuming when in the
            AnimationStateStartWaitStyleAvailable state. This was causing an
            assert when going out of the pause state because the paused flag
            was not set.
    
            The fix is a straightforward implementation, going into a new
            AnimationStatePausedWaitStyleAvailable state and setting the paused
            flag (actually setting the m_pauseTime variable to something other
            than -1). Also added handling of the new state, both when the
            "style available" callback comes in while in this state and when
            unpausing while in this state.
    
            For now a LayoutTest is not possible since there's no way to go in
            and out of the pause state. I've opened https://bugs.webkit.org/show_bug.cgi?id=42790
            to track this.
    
            * page/animation/AnimationBase.cpp:
            (WebCore::AnimationBase::updateStateMachine):
            * page/animation/AnimationBase.h:
            (WebCore::AnimationBase::):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63862 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 79eb390..bf9f06c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2010-07-21  Chris Marrin  <cmarrin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Assertion failure in AnimationBase::updateStateMachine() coming out of paused state
+        https://bugs.webkit.org/show_bug.cgi?id=37993
+        
+        Added logic to properly handle pausing and resuming when in the 
+        AnimationStateStartWaitStyleAvailable state. This was causing an
+        assert when going out of the pause state because the paused flag
+        was not set.
+        
+        The fix is a straightforward implementation, going into a new
+        AnimationStatePausedWaitStyleAvailable state and setting the paused
+        flag (actually setting the m_pauseTime variable to something other
+        than -1). Also added handling of the new state, both when the 
+        "style available" callback comes in while in this state and when
+        unpausing while in this state. 
+        
+        For now a LayoutTest is not possible since there's no way to go in
+        and out of the pause state. I've opened https://bugs.webkit.org/show_bug.cgi?id=42790
+        to track this.
+
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::updateStateMachine):
+        * page/animation/AnimationBase.h:
+        (WebCore::AnimationBase::):
+
 2010-07-21  Bo Liu  <boliu at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index 83fd039..4f304e2 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -964,28 +964,33 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
         case AnimationStateStartWaitStyleAvailable:
             ASSERT(input == AnimationStateInputStyleAvailable || input == AnimationStateInputPlayStatePaused);
 
-            // Start timer has fired, tell the animation to start and wait for it to respond with start time
-            m_animState = AnimationStateStartWaitResponse;
+            if (input == AnimationStateInputStyleAvailable) {
+                // Start timer has fired, tell the animation to start and wait for it to respond with start time
+                m_animState = AnimationStateStartWaitResponse;
 
-            overrideAnimations();
+                overrideAnimations();
+
+                // Start the animation
+                if (overridden()) {
+                    // We won't try to start accelerated animations if we are overridden and
+                    // just move on to the next state.
+                    m_animState = AnimationStateStartWaitResponse;
+                    m_isAccelerated = false;
+                    updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
+                } else {
+                    double timeOffset = 0;
+                    // If the value for 'animation-delay' is negative then the animation appears to have started in the past.
+                    if (m_animation->delay() < 0)
+                        timeOffset = -m_animation->delay();
+                    bool started = startAnimation(timeOffset);
 
-            // Start the animation
-            if (overridden()) {
-                // We won't try to start accelerated animations if we are overridden and
-                // just move on to the next state.
-                m_animState = AnimationStateStartWaitResponse;
-                m_isAccelerated = false;
-                updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
-            }
-            else {
-                double timeOffset = 0;
-                // If the value for 'animation-delay' is negative then the animation appears to have started in the past.
-                if (m_animation->delay() < 0)
-                    timeOffset = -m_animation->delay();
-                bool started = startAnimation(timeOffset);
-
-                m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
-                m_isAccelerated = started;
+                    m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
+                    m_isAccelerated = started;
+                }
+            } else {
+                // We're waiting for the style to be available and we got a pause. Pause and wait
+                m_pauseTime = beginAnimationUpdateTime();
+                m_animState = AnimationStatePausedWaitStyleAvailable;
             }
             break;
         case AnimationStateStartWaitResponse:
@@ -1075,17 +1080,51 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
             updateStateMachine(AnimationStateInputStartAnimation, 0);
             break;
         case AnimationStatePausedWaitResponse:
+        case AnimationStatePausedWaitStyleAvailable:
         case AnimationStatePausedRun:
             // We treat these two cases the same. The only difference is that, when we are in
             // AnimationStatePausedWaitResponse, we don't yet have a valid startTime, so we send 0 to startAnimation.
             // When the AnimationStateInputStartTimeSet comes in and we were in AnimationStatePausedRun, we will notice
             // that we have already set the startTime and will ignore it.
-            ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet);
+            ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet || input == AnimationStateInputStyleAvailable);
             ASSERT(paused());
             
-            // If we are paused, but we get the callback that notifies us that an accelerated animation started,
-            // then we ignore the start time and just move into the paused-run state.
-            if (m_animState == AnimationStatePausedWaitResponse && input == AnimationStateInputStartTimeSet) {
+            if (input == AnimationStateInputPlayStateRunning) {
+                // Update the times
+                if (m_animState == AnimationStatePausedRun)
+                    m_startTime += beginAnimationUpdateTime() - m_pauseTime;
+                else
+                    m_startTime = 0;
+                m_pauseTime = -1;
+
+                if (m_animState == AnimationStatePausedWaitStyleAvailable)
+                    m_animState = AnimationStateStartWaitStyleAvailable;
+                else {
+                    // We were either running or waiting for a begin time response from the animation.
+                    // Either way we need to restart the animation (possibly with an offset if we
+                    // had already been running) and wait for it to start.
+                    m_animState = AnimationStateStartWaitResponse;
+
+                    // Start the animation
+                    if (overridden()) {
+                        // We won't try to start accelerated animations if we are overridden and
+                        // just move on to the next state.
+                        updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
+                        m_isAccelerated = true;
+                    } else {
+                        bool started = startAnimation(beginAnimationUpdateTime() - m_startTime);
+                        m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
+                        m_isAccelerated = !started;
+                    }
+                }
+                break;
+            }
+            
+            if (input == AnimationStateInputStartTimeSet) {
+                ASSERT(m_animState == AnimationStatePausedWaitResponse);
+                
+                // We are paused but we got the callback that notifies us that an accelerated animation started.
+                // We ignore the start time and just move into the paused-run state.
                 m_animState = AnimationStatePausedRun;
                 ASSERT(m_startTime == 0);
                 m_startTime = param;
@@ -1093,27 +1132,11 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
                 break;
             }
             
-            // Update the times
-            if (m_animState == AnimationStatePausedRun)
-                m_startTime += beginAnimationUpdateTime() - m_pauseTime;
-            else
-                m_startTime = 0;
-            m_pauseTime = -1;
-
-            // We were waiting for a begin time response from the animation, go back and wait again
-            m_animState = AnimationStateStartWaitResponse;
-
-            // Start the animation
-            if (overridden()) {
-                // We won't try to start accelerated animations if we are overridden and
-                // just move on to the next state.
-                updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime());
-                m_isAccelerated = false;
-            } else {
-                bool started = startAnimation(beginAnimationUpdateTime() - m_startTime);
-                m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started);
-                m_isAccelerated = started;
-            }
+            ASSERT(m_animState == AnimationStatePausedWaitStyleAvailable);
+            // We are paused but we got the callback that notifies us that style has been updated.
+            // We move to the AnimationStatePausedWaitResponse state
+            m_animState = AnimationStatePausedWaitResponse;
+            overrideAnimations();
             break;
         case AnimationStateFillingForwards:
         case AnimationStateDone:
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index 9bdca3a..33a0b1d 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -69,6 +69,7 @@ public:
         AnimationStateLooping,              // response received, animation running, loop timer running, waiting for fire
         AnimationStateEnding,               // received, animation running, end timer running, waiting for fire
         AnimationStatePausedWaitTimer,      // in pause mode when animation started
+        AnimationStatePausedWaitStyleAvailable, // in pause mode when waiting for style setup
         AnimationStatePausedWaitResponse,   // animation paused when in STARTING state
         AnimationStatePausedRun,            // animation paused when in LOOPING or ENDING state
         AnimationStateDone,                 // end timer fired, animation finished and removed

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list