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

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

Issue 2732223002: Update DevTools animation timeline to handle TransitionKeyframeEffectModels (Closed)
Patch Set: timout-expectations Created 3 years, 9 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/animation/animation-transition-setTiming-crash-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 e0568b32861ec810c5b6bfb760e33cd77eb279dd..1dc5cab0b300954966b68a8ee34ca182d5c8eb95 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -302,6 +302,14 @@ blink::Animation* InspectorAnimationAgent::animationClone(
for (auto& oldKeyframe : oldKeyframes)
newKeyframes.push_back(toAnimatableValueKeyframe(oldKeyframe.get()));
newModel = AnimatableValueKeyframeEffectModel::create(newKeyframes);
+ } else if (oldModel->isTransitionKeyframeEffectModel()) {
+ TransitionKeyframeEffectModel* oldTransitionKeyframeModel =
+ toTransitionKeyframeEffectModel(oldModel);
+ KeyframeVector oldKeyframes = oldTransitionKeyframeModel->getFrames();
+ TransitionKeyframeVector newKeyframes;
+ for (auto& oldKeyframe : oldKeyframes)
+ newKeyframes.push_back(toTransitionKeyframe(oldKeyframe.get()));
+ newModel = TransitionKeyframeEffectModel::create(newKeyframes);
}
KeyframeEffect* newEffect = KeyframeEffect::create(
@@ -372,15 +380,15 @@ Response InspectorAnimationAgent::setTiming(const String& animationId,
if (type == AnimationType::CSSTransition) {
KeyframeEffect* effect = toKeyframeEffect(animation->effect());
KeyframeEffectModelBase* model = toKeyframeEffectModelBase(effect->model());
- const AnimatableValueKeyframeEffectModel* oldModel =
- toAnimatableValueKeyframeEffectModel(model);
+ const TransitionKeyframeEffectModel* oldModel =
+ toTransitionKeyframeEffectModel(model);
// Refer to CSSAnimations::calculateTransitionUpdateForProperty() for the
// structure of transitions.
const KeyframeVector& frames = oldModel->getFrames();
ASSERT(frames.size() == 3);
KeyframeVector newFrames;
for (int i = 0; i < 3; i++)
- newFrames.push_back(toAnimatableValueKeyframe(frames[i]->clone().get()));
+ newFrames.push_back(toTransitionKeyframe(frames[i]->clone().get()));
// Update delay, represented by the distance between the first two
// keyframes.
newFrames[1]->setOffset(delay / (delay + duration));
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698