| 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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 if (m_content) { | 785 if (m_content) { |
| 786 double inheritedTime = idle || isNull(m_timeline->currentTimeInternal())
? nullValue() : currentTimeInternal(); | 786 double inheritedTime = idle || isNull(m_timeline->currentTimeInternal())
? nullValue() : currentTimeInternal(); |
| 787 // Special case for end-exclusivity when playing backwards. | 787 // Special case for end-exclusivity when playing backwards. |
| 788 if (inheritedTime == 0 && m_playbackRate < 0) | 788 if (inheritedTime == 0 && m_playbackRate < 0) |
| 789 inheritedTime = -1; | 789 inheritedTime = -1; |
| 790 m_content->updateInheritedTime(inheritedTime, reason); | 790 m_content->updateInheritedTime(inheritedTime, reason); |
| 791 } | 791 } |
| 792 | 792 |
| 793 if ((idle || limited()) && !m_finished) { | 793 if ((idle || limited()) && !m_finished) { |
| 794 if (reason == TimingUpdateForAnimationFrame && (idle || hasStartTime()))
{ | 794 if (reason == TimingUpdateForAnimationFrame && (idle || hasStartTime()))
{ |
| 795 const AtomicString& eventType = EventTypeNames::finish; | 795 if (idle) { |
| 796 if (executionContext() && hasEventListeners(eventType)) { | 796 // TODO(dstockwell): Fire the cancel event. |
| 797 double eventCurrentTime = currentTimeInternal() * 1000; | 797 } else { |
| 798 m_pendingFinishedEvent = AnimationPlayerEvent::create(eventType,
eventCurrentTime, timeline()->currentTime()); | 798 const AtomicString& eventType = EventTypeNames::finish; |
| 799 m_pendingFinishedEvent->setTarget(this); | 799 if (executionContext() && hasEventListeners(eventType)) { |
| 800 m_pendingFinishedEvent->setCurrentTarget(this); | 800 double eventCurrentTime = currentTimeInternal() * 1000; |
| 801 m_timeline->document()->enqueueAnimationFrameEvent(m_pendingFini
shedEvent); | 801 m_pendingFinishedEvent = AnimationPlayerEvent::create(eventT
ype, eventCurrentTime, timeline()->currentTime()); |
| 802 m_pendingFinishedEvent->setTarget(this); |
| 803 m_pendingFinishedEvent->setCurrentTarget(this); |
| 804 m_timeline->document()->enqueueAnimationFrameEvent(m_pending
FinishedEvent); |
| 805 } |
| 802 } | 806 } |
| 803 m_finished = true; | 807 m_finished = true; |
| 804 } | 808 } |
| 805 } | 809 } |
| 806 ASSERT(!m_outdated); | 810 ASSERT(!m_outdated); |
| 807 return !m_finished; | 811 return !m_finished; |
| 808 } | 812 } |
| 809 | 813 |
| 810 double Animation::timeToEffectChange() | 814 double Animation::timeToEffectChange() |
| 811 { | 815 { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 visitor->trace(m_content); | 1028 visitor->trace(m_content); |
| 1025 visitor->trace(m_timeline); | 1029 visitor->trace(m_timeline); |
| 1026 visitor->trace(m_pendingFinishedEvent); | 1030 visitor->trace(m_pendingFinishedEvent); |
| 1027 visitor->trace(m_finishedPromise); | 1031 visitor->trace(m_finishedPromise); |
| 1028 visitor->trace(m_readyPromise); | 1032 visitor->trace(m_readyPromise); |
| 1029 EventTargetWithInlineData::trace(visitor); | 1033 EventTargetWithInlineData::trace(visitor); |
| 1030 ActiveDOMObject::trace(visitor); | 1034 ActiveDOMObject::trace(visitor); |
| 1031 } | 1035 } |
| 1032 | 1036 |
| 1033 } // namespace | 1037 } // namespace |
| OLD | NEW |