| 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 "core/inspector/InspectorAnimationAgent.h" | 5 #include "core/inspector/InspectorAnimationAgent.h" |
| 6 | 6 |
| 7 #include "core/animation/Animation.h" | 7 #include "core/animation/Animation.h" |
| 8 #include "core/animation/AnimationEffectReadOnly.h" | 8 #include "core/animation/AnimationEffectReadOnly.h" |
| 9 #include "core/animation/AnimationEffectTiming.h" | 9 #include "core/animation/AnimationEffectTiming.h" |
| 10 #include "core/animation/ComputedTimingProperties.h" | 10 #include "core/animation/ComputedTimingProperties.h" |
| 11 #include "core/animation/EffectModel.h" | 11 #include "core/animation/EffectModel.h" |
| 12 #include "core/animation/ElementAnimation.h" | 12 #include "core/animation/ElementAnimation.h" |
| 13 #include "core/animation/KeyframeEffect.h" | 13 #include "core/animation/KeyframeEffect.h" |
| 14 #include "core/animation/KeyframeEffectModel.h" | 14 #include "core/animation/KeyframeEffectModel.h" |
| 15 #include "core/animation/StringKeyframe.h" | 15 #include "core/animation/StringKeyframe.h" |
| 16 #include "core/css/CSSKeyframeRule.h" | 16 #include "core/css/CSSKeyframeRule.h" |
| 17 #include "core/css/CSSKeyframesRule.h" | 17 #include "core/css/CSSKeyframesRule.h" |
| 18 #include "core/css/CSSRuleList.h" | 18 #include "core/css/CSSRuleList.h" |
| 19 #include "core/css/CSSStyleRule.h" | 19 #include "core/css/CSSStyleRule.h" |
| 20 #include "core/css/resolver/StyleResolver.h" | 20 #include "core/css/resolver/StyleResolver.h" |
| 21 #include "core/dom/DOMNodeIds.h" | 21 #include "core/dom/DOMNodeIds.h" |
| 22 #include "core/dom/NodeComputedStyle.h" | 22 #include "core/dom/NodeComputedStyle.h" |
| 23 #include "core/frame/LocalFrame.h" | 23 #include "core/frame/LocalFrame.h" |
| 24 #include "core/inspector/InspectedFrames.h" | 24 #include "core/inspector/InspectedFrames.h" |
| 25 #include "core/inspector/InspectorCSSAgent.h" | 25 #include "core/inspector/InspectorCSSAgent.h" |
| 26 #include "core/inspector/InspectorDOMAgent.h" | 26 #include "core/inspector/InspectorDOMAgent.h" |
| 27 #include "core/inspector/InspectorStyleSheet.h" | 27 #include "core/inspector/InspectorStyleSheet.h" |
| 28 #include "core/inspector/V8InspectorString.h" |
| 28 #include "platform/Decimal.h" | 29 #include "platform/Decimal.h" |
| 29 #include "platform/animation/TimingFunction.h" | 30 #include "platform/animation/TimingFunction.h" |
| 30 #include "platform/v8_inspector/public/V8InspectorSession.h" | 31 #include "platform/v8_inspector/public/V8InspectorSession.h" |
| 31 #include "wtf/text/Base64.h" | 32 #include "wtf/text/Base64.h" |
| 32 #include <memory> | 33 #include <memory> |
| 33 | 34 |
| 34 namespace AnimationAgentState { | 35 namespace AnimationAgentState { |
| 35 static const char animationAgentEnabled[] = "animationAgentEnabled"; | 36 static const char animationAgentEnabled[] = "animationAgentEnabled"; |
| 36 static const char animationAgentPlaybackRate[] = "animationAgentPlaybackRate"; | 37 static const char animationAgentPlaybackRate[] = "animationAgentPlaybackRate"; |
| 37 } | 38 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 const Element* element = toKeyframeEffect(animation->effect())->target(); | 367 const Element* element = toKeyframeEffect(animation->effect())->target(); |
| 367 Document* document = element->ownerDocument(); | 368 Document* document = element->ownerDocument(); |
| 368 LocalFrame* frame = document ? document->frame() : nullptr; | 369 LocalFrame* frame = document ? document->frame() : nullptr; |
| 369 ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullpt
r; | 370 ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullpt
r; |
| 370 if (!scriptState) { | 371 if (!scriptState) { |
| 371 *errorString = "Element not associated with a document."; | 372 *errorString = "Element not associated with a document."; |
| 372 return; | 373 return; |
| 373 } | 374 } |
| 374 | 375 |
| 375 ScriptState::Scope scope(scriptState); | 376 ScriptState::Scope scope(scriptState); |
| 376 m_v8Session->releaseObjectGroup("animation"); | 377 static const char kAnimationObjectGroup[] = "animation"; |
| 377 *result = m_v8Session->wrapObject(scriptState->context(), toV8(animation, sc
riptState->context()->Global(), scriptState->isolate()), "animation"); | 378 m_v8Session->releaseObjectGroup(toV8InspectorStringView(kAnimationObjectGrou
p)); |
| 379 *result = m_v8Session->wrapObject(scriptState->context(), toV8(animation, sc
riptState->context()->Global(), scriptState->isolate()), toV8InspectorStringView
(kAnimationObjectGroup)); |
| 378 if (!*result) | 380 if (!*result) |
| 379 *errorString = "Element not associated with a document."; | 381 *errorString = "Element not associated with a document."; |
| 380 } | 382 } |
| 381 | 383 |
| 382 static CSSPropertyID animationProperties[] = { | 384 static CSSPropertyID animationProperties[] = { |
| 383 CSSPropertyAnimationDelay, | 385 CSSPropertyAnimationDelay, |
| 384 CSSPropertyAnimationDirection, | 386 CSSPropertyAnimationDirection, |
| 385 CSSPropertyAnimationDuration, | 387 CSSPropertyAnimationDuration, |
| 386 CSSPropertyAnimationFillMode, | 388 CSSPropertyAnimationFillMode, |
| 387 CSSPropertyAnimationIterationCount, | 389 CSSPropertyAnimationIterationCount, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 { | 490 { |
| 489 visitor->trace(m_inspectedFrames); | 491 visitor->trace(m_inspectedFrames); |
| 490 visitor->trace(m_domAgent); | 492 visitor->trace(m_domAgent); |
| 491 visitor->trace(m_cssAgent); | 493 visitor->trace(m_cssAgent); |
| 492 visitor->trace(m_idToAnimation); | 494 visitor->trace(m_idToAnimation); |
| 493 visitor->trace(m_idToAnimationClone); | 495 visitor->trace(m_idToAnimationClone); |
| 494 InspectorBaseAgent::trace(visitor); | 496 InspectorBaseAgent::trace(visitor); |
| 495 } | 497 } |
| 496 | 498 |
| 497 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |