Index: Source/core/page/PageAnimator.cpp |
diff --git a/Source/core/page/PageAnimator.cpp b/Source/core/page/PageAnimator.cpp |
index 4a1e2837db6cf382dfb6fb4394cfc16708e9c6f4..d4e8024fa54e51daffb7ae62aefcff2133a6676a 100644 |
--- a/Source/core/page/PageAnimator.cpp |
+++ b/Source/core/page/PageAnimator.cpp |
@@ -50,8 +50,12 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
if (documents[i]->frame()) { |
documents[i]->view()->serviceScrollAnimations(monotonicAnimationStartTime); |
- if (const FrameView::ScrollableAreaSet* scrollableAreas = documents[i]->view()->scrollableAreas()) { |
- for (ScrollableArea* scrollableArea : *scrollableAreas) |
+ if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = documents[i]->view()->animatingScrollableAreas()) { |
+ // Iterate over a copy, since ScrollableAreas may deregister |
+ // themselves during the iteration. |
+ Vector<ScrollableArea*> animatingScrollableAreasCopy; |
+ copyToVector(*animatingScrollableAreas, animatingScrollableAreasCopy); |
+ for (ScrollableArea* scrollableArea : animatingScrollableAreasCopy) |
scrollableArea->serviceScrollAnimations(monotonicAnimationStartTime); |
} |
} |