| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/inspector/InspectorAnimationAgent.h" | 7 #include "core/inspector/InspectorAnimationAgent.h" |
| 8 | 8 |
| 9 #include "core/animation/Animation.h" | 9 #include "core/animation/Animation.h" |
| 10 #include "core/animation/AnimationEffect.h" | 10 #include "core/animation/AnimationEffect.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 ComputedTimingProperties computedTiming; | 77 ComputedTimingProperties computedTiming; |
| 78 effect->computedTiming(computedTiming); | 78 effect->computedTiming(computedTiming); |
| 79 double delay = computedTiming.delay(); | 79 double delay = computedTiming.delay(); |
| 80 double duration = computedTiming.duration().getAsUnrestrictedDouble(); | 80 double duration = computedTiming.duration().getAsUnrestrictedDouble(); |
| 81 String easing = effect->specifiedTiming().timingFunction->toString(); | 81 String easing = effect->specifiedTiming().timingFunction->toString(); |
| 82 | 82 |
| 83 if (isTransition) { | 83 if (isTransition) { |
| 84 // Obtain keyframes and convert keyframes back to delay | 84 // Obtain keyframes and convert keyframes back to delay |
| 85 ASSERT(effect->model()->isKeyframeEffectModel()); | 85 ASSERT(effect->model()->isKeyframeEffectModel()); |
| 86 const KeyframeEffectModelBase* model = toKeyframeEffectModelBase(effect-
>model()); | 86 const KeyframeEffectModelBase* model = toKeyframeEffectModelBase(effect-
>model()); |
| 87 WillBeHeapVector<RefPtrWillBeMember<Keyframe> > keyframes = KeyframeEffe
ctModelBase::normalizedKeyframesForInspector(model->getFrames()); | 87 Vector<RefPtr<Keyframe>> keyframes = KeyframeEffectModelBase::normalized
KeyframesForInspector(model->getFrames()); |
| 88 if (keyframes.size() == 3) { | 88 if (keyframes.size() == 3) { |
| 89 delay = keyframes.at(1)->offset() * duration; | 89 delay = keyframes.at(1)->offset() * duration; |
| 90 duration -= delay; | 90 duration -= delay; |
| 91 easing = keyframes.at(1)->easing().toString(); | 91 easing = keyframes.at(1)->easing().toString(); |
| 92 } else { | 92 } else { |
| 93 easing = keyframes.at(0)->easing().toString(); | 93 easing = keyframes.at(0)->easing().toString(); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 RefPtr<TypeBuilder::Animation::AnimationEffect> animationObject = TypeBuilde
r::Animation::AnimationEffect::create() | 97 RefPtr<TypeBuilder::Animation::AnimationEffect> animationObject = TypeBuilde
r::Animation::AnimationEffect::create() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 119 .setOffset(offset) | 119 .setOffset(offset) |
| 120 .setEasing(keyframe->easing().toString()); | 120 .setEasing(keyframe->easing().toString()); |
| 121 return keyframeObject.release(); | 121 return keyframeObject.release(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 static PassRefPtr<TypeBuilder::Animation::KeyframesRule> buildObjectForAnimation
Keyframes(const KeyframeEffect* effect) | 124 static PassRefPtr<TypeBuilder::Animation::KeyframesRule> buildObjectForAnimation
Keyframes(const KeyframeEffect* effect) |
| 125 { | 125 { |
| 126 if (!effect || !effect->model() || !effect->model()->isKeyframeEffectModel()
) | 126 if (!effect || !effect->model() || !effect->model()->isKeyframeEffectModel()
) |
| 127 return nullptr; | 127 return nullptr; |
| 128 const KeyframeEffectModelBase* model = toKeyframeEffectModelBase(effect->mod
el()); | 128 const KeyframeEffectModelBase* model = toKeyframeEffectModelBase(effect->mod
el()); |
| 129 WillBeHeapVector<RefPtrWillBeMember<Keyframe> > normalizedKeyframes = Keyfra
meEffectModelBase::normalizedKeyframesForInspector(model->getFrames()); | 129 Vector<RefPtr<Keyframe>> normalizedKeyframes = KeyframeEffectModelBase::norm
alizedKeyframesForInspector(model->getFrames()); |
| 130 RefPtr<TypeBuilder::Array<TypeBuilder::Animation::KeyframeStyle> > keyframes
= TypeBuilder::Array<TypeBuilder::Animation::KeyframeStyle>::create(); | 130 RefPtr<TypeBuilder::Array<TypeBuilder::Animation::KeyframeStyle> > keyframes
= TypeBuilder::Array<TypeBuilder::Animation::KeyframeStyle>::create(); |
| 131 | 131 |
| 132 for (const auto& keyframe : normalizedKeyframes) { | 132 for (const auto& keyframe : normalizedKeyframes) { |
| 133 // Ignore CSS Transitions | 133 // Ignore CSS Transitions |
| 134 if (!keyframe.get()->isStringKeyframe()) | 134 if (!keyframe.get()->isStringKeyframe()) |
| 135 continue; | 135 continue; |
| 136 const StringKeyframe* stringKeyframe = toStringKeyframe(keyframe.get()); | 136 const StringKeyframe* stringKeyframe = toStringKeyframe(keyframe.get()); |
| 137 keyframes->addItem(buildObjectForStringKeyframe(stringKeyframe)); | 137 keyframes->addItem(buildObjectForStringKeyframe(stringKeyframe)); |
| 138 } | 138 } |
| 139 RefPtr<TypeBuilder::Animation::KeyframesRule> keyframesObject = TypeBuilder:
:Animation::KeyframesRule::create() | 139 RefPtr<TypeBuilder::Animation::KeyframesRule> keyframesObject = TypeBuilder:
:Animation::KeyframesRule::create() |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 #if ENABLE(OILPAN) | 295 #if ENABLE(OILPAN) |
| 296 visitor->trace(m_pageAgent); | 296 visitor->trace(m_pageAgent); |
| 297 visitor->trace(m_domAgent); | 297 visitor->trace(m_domAgent); |
| 298 visitor->trace(m_idToAnimation); | 298 visitor->trace(m_idToAnimation); |
| 299 visitor->trace(m_idToAnimationType); | 299 visitor->trace(m_idToAnimationType); |
| 300 #endif | 300 #endif |
| 301 InspectorBaseAgent::trace(visitor); | 301 InspectorBaseAgent::trace(visitor); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } | 304 } |
| OLD | NEW |