Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(860)

Unified Diff: third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp

Issue 1500443002: CSS Animations: Fix crash where update isn't applied (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/animation-css-cancel-update-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
index 9e9aa0903db57c5f66350dbc6bbc1a4e0922244a..2d4a718b681d45a359d7d9534d506f74311d69d0 100644
--- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
+++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
@@ -365,15 +365,6 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
// https://code.google.com/p/chromium/issues/detail?id=339847
DisableCompositingQueryAsserts disabler;
- const Vector<size_t>& cancelledIndices = m_pendingUpdate.cancelledAnimationIndices();
- for (size_t i = cancelledIndices.size(); i-- > 0;) {
- ASSERT(i == cancelledIndices.size() - 1 || cancelledIndices[i] < cancelledIndices[i + 1]);
- Animation& animation = *m_runningAnimations[cancelledIndices[i]]->animation;
- animation.cancel();
- animation.update(TimingUpdateOnDemand);
- m_runningAnimations.remove(cancelledIndices[i]);
- }
-
for (size_t pausedIndex : m_pendingUpdate.animationIndicesWithPauseToggled()) {
Animation& animation = *m_runningAnimations[pausedIndex]->animation;
if (animation.paused())
@@ -396,6 +387,15 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
m_runningAnimations[entry.index]->update(entry);
}
+ const Vector<size_t>& cancelledIndices = m_pendingUpdate.cancelledAnimationIndices();
+ for (size_t i = cancelledIndices.size(); i-- > 0;) {
+ ASSERT(i == cancelledIndices.size() - 1 || cancelledIndices[i] < cancelledIndices[i + 1]);
+ Animation& animation = *m_runningAnimations[cancelledIndices[i]]->animation;
+ animation.cancel();
+ animation.update(TimingUpdateOnDemand);
+ m_runningAnimations.remove(cancelledIndices[i]);
+ }
+
for (const auto& entry : m_pendingUpdate.newAnimations()) {
const InertEffect* inertAnimation = entry.effect.get();
AnimationEventDelegate* eventDelegate = new AnimationEventDelegate(element, entry.name);
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/animation-css-cancel-update-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698