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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp

Issue 2656273003: Detect/report animations that are cancelled after they start. (Closed)
Patch Set: Slight comment fix Created 3 years, 11 months 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/inspector-protocol/animation/animation-start-cancel-expected.txt ('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/inspector/InspectorAnimationAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
index 081bdb56fff104c1dc4a89725e412581c78e3f7e..c08cdce77ac7840d58a4ec869497bc3e65105772 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -500,11 +500,16 @@ void InspectorAnimationAgent::animationPlayStateChanged(
blink::Animation::AnimationPlayState oldPlayState,
blink::Animation::AnimationPlayState newPlayState) {
const String& animationId = String::number(animation->sequenceNumber());
- if (m_idToAnimation.get(animationId) ||
- m_clearedAnimations.contains(animationId))
+
+ // We no longer care about animations that have been released.
+ if (m_clearedAnimations.contains(animationId))
return;
- if (newPlayState == blink::Animation::Running ||
- newPlayState == blink::Animation::Finished)
+
+ // Record newly starting animations only once, as |buildObjectForAnimation|
+ // constructs and caches our internal representation of the given |animation|.
+ if ((newPlayState == blink::Animation::Running ||
+ newPlayState == blink::Animation::Finished) &&
+ !m_idToAnimation.contains(animationId))
frontend()->animationStarted(buildObjectForAnimation(*animation));
else if (newPlayState == blink::Animation::Idle ||
newPlayState == blink::Animation::Paused)
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698