OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "core/animation/Animation.h" | 31 #include "core/animation/Animation.h" |
32 | 32 |
33 #include "core/animation/AnimationTimeline.h" | 33 #include "core/animation/AnimationTimeline.h" |
34 #include "core/animation/CompositorPendingAnimations.h" | 34 #include "core/animation/CompositorPendingAnimations.h" |
35 #include "core/animation/KeyframeEffect.h" | 35 #include "core/animation/KeyframeEffect.h" |
36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
38 #include "core/dom/StyleChangeReason.h" | 38 #include "core/dom/StyleChangeReason.h" |
39 #include "core/events/AnimationPlayerEvent.h" | 39 #include "core/events/AnimationPlaybackEvent.h" |
40 #include "core/frame/UseCounter.h" | 40 #include "core/frame/UseCounter.h" |
41 #include "core/inspector/InspectorInstrumentation.h" | 41 #include "core/inspector/InspectorInstrumentation.h" |
42 #include "core/inspector/InspectorTraceEvents.h" | 42 #include "core/inspector/InspectorTraceEvents.h" |
43 #include "platform/RuntimeEnabledFeatures.h" | 43 #include "platform/RuntimeEnabledFeatures.h" |
44 #include "platform/TraceEvent.h" | 44 #include "platform/TraceEvent.h" |
45 #include "platform/animation/CompositorAnimationPlayer.h" | 45 #include "platform/animation/CompositorAnimationPlayer.h" |
46 #include "public/platform/Platform.h" | 46 #include "public/platform/Platform.h" |
47 #include "public/platform/WebCompositorSupport.h" | 47 #include "public/platform/WebCompositorSupport.h" |
48 #include "wtf/MathExtras.h" | 48 #include "wtf/MathExtras.h" |
49 #include "wtf/PtrUtil.h" | 49 #include "wtf/PtrUtil.h" |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 inheritedTime = -1; | 828 inheritedTime = -1; |
829 m_content->updateInheritedTime(inheritedTime, reason); | 829 m_content->updateInheritedTime(inheritedTime, reason); |
830 } | 830 } |
831 | 831 |
832 if ((idle || limited()) && !m_finished) { | 832 if ((idle || limited()) && !m_finished) { |
833 if (reason == TimingUpdateForAnimationFrame && (idle || hasStartTime()))
{ | 833 if (reason == TimingUpdateForAnimationFrame && (idle || hasStartTime()))
{ |
834 if (idle) { | 834 if (idle) { |
835 const AtomicString& eventType = EventTypeNames::cancel; | 835 const AtomicString& eventType = EventTypeNames::cancel; |
836 if (getExecutionContext() && hasEventListeners(eventType)) { | 836 if (getExecutionContext() && hasEventListeners(eventType)) { |
837 double eventCurrentTime = nullValue(); | 837 double eventCurrentTime = nullValue(); |
838 m_pendingCancelledEvent = AnimationPlayerEvent::create(event
Type, eventCurrentTime, timeline()->currentTime()); | 838 m_pendingCancelledEvent = AnimationPlaybackEvent::create(eve
ntType, eventCurrentTime, timeline()->currentTime()); |
839 m_pendingCancelledEvent->setTarget(this); | 839 m_pendingCancelledEvent->setTarget(this); |
840 m_pendingCancelledEvent->setCurrentTarget(this); | 840 m_pendingCancelledEvent->setCurrentTarget(this); |
841 m_timeline->document()->enqueueAnimationFrameEvent(m_pending
CancelledEvent); | 841 m_timeline->document()->enqueueAnimationFrameEvent(m_pending
CancelledEvent); |
842 } | 842 } |
843 } else { | 843 } else { |
844 const AtomicString& eventType = EventTypeNames::finish; | 844 const AtomicString& eventType = EventTypeNames::finish; |
845 if (getExecutionContext() && hasEventListeners(eventType)) { | 845 if (getExecutionContext() && hasEventListeners(eventType)) { |
846 double eventCurrentTime = currentTimeInternal() * 1000; | 846 double eventCurrentTime = currentTimeInternal() * 1000; |
847 m_pendingFinishedEvent = AnimationPlayerEvent::create(eventT
ype, eventCurrentTime, timeline()->currentTime()); | 847 m_pendingFinishedEvent = AnimationPlaybackEvent::create(even
tType, eventCurrentTime, timeline()->currentTime()); |
848 m_pendingFinishedEvent->setTarget(this); | 848 m_pendingFinishedEvent->setTarget(this); |
849 m_pendingFinishedEvent->setCurrentTarget(this); | 849 m_pendingFinishedEvent->setCurrentTarget(this); |
850 m_timeline->document()->enqueueAnimationFrameEvent(m_pending
FinishedEvent); | 850 m_timeline->document()->enqueueAnimationFrameEvent(m_pending
FinishedEvent); |
851 } | 851 } |
852 } | 852 } |
853 m_finished = true; | 853 m_finished = true; |
854 } | 854 } |
855 } | 855 } |
856 DCHECK(!m_outdated); | 856 DCHECK(!m_outdated); |
857 return !m_finished || std::isfinite(timeToEffectChange()); | 857 return !m_finished || std::isfinite(timeToEffectChange()); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 visitor->trace(m_timeline); | 1100 visitor->trace(m_timeline); |
1101 visitor->trace(m_pendingFinishedEvent); | 1101 visitor->trace(m_pendingFinishedEvent); |
1102 visitor->trace(m_pendingCancelledEvent); | 1102 visitor->trace(m_pendingCancelledEvent); |
1103 visitor->trace(m_finishedPromise); | 1103 visitor->trace(m_finishedPromise); |
1104 visitor->trace(m_readyPromise); | 1104 visitor->trace(m_readyPromise); |
1105 EventTargetWithInlineData::trace(visitor); | 1105 EventTargetWithInlineData::trace(visitor); |
1106 ActiveDOMObject::trace(visitor); | 1106 ActiveDOMObject::trace(visitor); |
1107 } | 1107 } |
1108 | 1108 |
1109 } // namespace blink | 1109 } // namespace blink |
OLD | NEW |