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/AnimationEffect.h" | 8 #include "core/animation/AnimationEffect.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" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 timing->setDuration(unrestrictedDuration, exceptionState); | 350 timing->setDuration(unrestrictedDuration, exceptionState); |
351 } else { | 351 } else { |
352 AnimationEffectTiming* timing = animation->effect()->timing(); | 352 AnimationEffectTiming* timing = animation->effect()->timing(); |
353 UnrestrictedDoubleOrString unrestrictedDuration; | 353 UnrestrictedDoubleOrString unrestrictedDuration; |
354 unrestrictedDuration.setUnrestrictedDouble(duration); | 354 unrestrictedDuration.setUnrestrictedDouble(duration); |
355 timing->setDuration(unrestrictedDuration, exceptionState); | 355 timing->setDuration(unrestrictedDuration, exceptionState); |
356 timing->setDelay(delay); | 356 timing->setDelay(delay); |
357 } | 357 } |
358 } | 358 } |
359 | 359 |
360 void InspectorAnimationAgent::resolveAnimation(ErrorString* errorString, const S
tring& animationId, std::unique_ptr<protocol::Runtime::RemoteObject>* result) | 360 void InspectorAnimationAgent::resolveAnimation(ErrorString* errorString, const S
tring& animationId, std::unique_ptr<protocol::Runtime::API::RemoteObject>* resul
t) |
361 { | 361 { |
362 blink::Animation* animation = assertAnimation(errorString, animationId); | 362 blink::Animation* animation = assertAnimation(errorString, animationId); |
363 if (!animation) | 363 if (!animation) |
364 return; | 364 return; |
365 if (m_idToAnimationClone.get(animationId)) | 365 if (m_idToAnimationClone.get(animationId)) |
366 animation = m_idToAnimationClone.get(animationId); | 366 animation = m_idToAnimationClone.get(animationId); |
367 const Element* element = toKeyframeEffect(animation->effect())->target(); | 367 const Element* element = toKeyframeEffect(animation->effect())->target(); |
368 Document* document = element->ownerDocument(); | 368 Document* document = element->ownerDocument(); |
369 LocalFrame* frame = document ? document->frame() : nullptr; | 369 LocalFrame* frame = document ? document->frame() : nullptr; |
370 ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullpt
r; | 370 ScriptState* scriptState = frame ? ScriptState::forMainWorld(frame) : nullpt
r; |
371 if (!scriptState) { | 371 if (!scriptState) { |
372 *errorString = "Element not associated with a document."; | 372 *errorString = "Element not associated with a document."; |
373 return; | 373 return; |
374 } | 374 } |
375 | 375 |
376 ScriptState::Scope scope(scriptState); | 376 ScriptState::Scope scope(scriptState); |
377 m_v8Session->releaseObjectGroup("animation"); | 377 m_v8Session->releaseObjectGroup("animation"); |
378 *result = m_v8Session->wrapObject(scriptState->context(), toV8(animation, sc
riptState->context()->Global(), scriptState->isolate()), "animation", false); | 378 *result = m_v8Session->wrapObject(scriptState->context(), toV8(animation, sc
riptState->context()->Global(), scriptState->isolate()), "animation"); |
379 if (!*result) | 379 if (!*result) |
380 *errorString = "Element not associated with a document."; | 380 *errorString = "Element not associated with a document."; |
381 } | 381 } |
382 | 382 |
383 static CSSPropertyID animationProperties[] = { | 383 static CSSPropertyID animationProperties[] = { |
384 CSSPropertyAnimationDelay, | 384 CSSPropertyAnimationDelay, |
385 CSSPropertyAnimationDirection, | 385 CSSPropertyAnimationDirection, |
386 CSSPropertyAnimationDuration, | 386 CSSPropertyAnimationDuration, |
387 CSSPropertyAnimationFillMode, | 387 CSSPropertyAnimationFillMode, |
388 CSSPropertyAnimationIterationCount, | 388 CSSPropertyAnimationIterationCount, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 { | 489 { |
490 visitor->trace(m_inspectedFrames); | 490 visitor->trace(m_inspectedFrames); |
491 visitor->trace(m_domAgent); | 491 visitor->trace(m_domAgent); |
492 visitor->trace(m_cssAgent); | 492 visitor->trace(m_cssAgent); |
493 visitor->trace(m_idToAnimation); | 493 visitor->trace(m_idToAnimation); |
494 visitor->trace(m_idToAnimationClone); | 494 visitor->trace(m_idToAnimationClone); |
495 InspectorBaseAgent::trace(visitor); | 495 InspectorBaseAgent::trace(visitor); |
496 } | 496 } |
497 | 497 |
498 } // namespace blink | 498 } // namespace blink |
OLD | NEW |