Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / animation / css / CSSPendingAnimations.cpp
index 3a4ec03..eac01ad 100644 (file)
@@ -34,6 +34,7 @@
 #include "core/animation/Animation.h"
 #include "core/animation/DocumentTimeline.h"
 #include "core/frame/FrameView.h"
+#include "core/rendering/RenderLayer.h"
 
 namespace WebCore {
 
@@ -43,12 +44,16 @@ void CSSPendingAnimations::add(Player* player)
     // The actual start time is either this value, or the time that
     // this animation, or an animation that it is synchronized with
     // is started on the compositor.
-    const double defaultStartTime = player->timeline().currentTime();
+    const double defaultStartTime = player->timeline()->currentTime();
     m_pending.append(std::make_pair(player, defaultStartTime));
 }
 
 bool CSSPendingAnimations::startPendingAnimations()
 {
+    // FIXME: This is called from within style recalc, at which point compositor state is not up to date.
+    // https://code.google.com/p/chromium/issues/detail?id=339847
+    DisableCompositingQueryAsserts disabler;
+
     bool startedOnCompositor = false;
     for (size_t i = 0; i < m_pending.size(); ++i) {
         if (m_pending[i].first->maybeStartAnimationOnCompositor())
@@ -62,8 +67,10 @@ bool CSSPendingAnimations::startPendingAnimations()
         for (size_t i = 0; i < m_pending.size(); ++i)
             m_waitingForCompositorAnimationStart.append(m_pending[i].first);
     } else {
-        for (size_t i = 0; i < m_pending.size(); ++i)
+        for (size_t i = 0; i < m_pending.size(); ++i) {
             m_pending[i].first->setStartTime(m_pending[i].second);
+            m_pending[i].first->update();
+        }
     }
     m_pending.clear();
 
@@ -85,7 +92,8 @@ void CSSPendingAnimations::notifyCompositorAnimationStarted(double monotonicAnim
 {
     for (size_t i = 0; i < m_waitingForCompositorAnimationStart.size(); ++i) {
         Player* player = m_waitingForCompositorAnimationStart[i].get();
-        player->setStartTime(monotonicAnimationStartTime - player->timeline().zeroTime());
+        player->setStartTime(monotonicAnimationStartTime - player->timeline()->zeroTime());
+        player->update();
     }
 
     m_waitingForCompositorAnimationStart.clear();