Index: Source/platform/scroll/ProgrammaticScrollAnimator.cpp |
diff --git a/Source/platform/scroll/ProgrammaticScrollAnimator.cpp b/Source/platform/scroll/ProgrammaticScrollAnimator.cpp |
index 7b2332936a21758aa06070ec8d54633bc147ff9b..f43c914e7f26554dd007de4f90cba4497b448fca 100644 |
--- a/Source/platform/scroll/ProgrammaticScrollAnimator.cpp |
+++ b/Source/platform/scroll/ProgrammaticScrollAnimator.cpp |
@@ -163,6 +163,23 @@ void ProgrammaticScrollAnimator::updateCompositorAnimations() |
} |
} |
+void ProgrammaticScrollAnimator::layerForCompositedScrollingDidChange() |
+{ |
+ // If the composited scrolling layer is lost during a composited animation, |
+ // continue the animation on the main thread. |
+ if (m_runState == RunState::RunningOnCompositor && !m_scrollableArea->layerForScrolling()) { |
+ m_runState = RunState::RunningOnMainThread; |
+ m_compositorAnimationId = 0; |
+ m_compositorAnimationGroupId = 0; |
+ m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPosition())); |
+ m_scrollableArea->registerForAnimation(); |
+ if (!m_scrollableArea->scheduleAnimation()) { |
+ resetAnimationState(); |
+ m_scrollableArea->notifyScrollPositionChanged(IntPoint(m_targetOffset.x(), m_targetOffset.y())); |
+ } |
+ } |
+} |
+ |
void ProgrammaticScrollAnimator::notifyCompositorAnimationFinished(int groupId) |
{ |
if (m_compositorAnimationGroupId != groupId) |