| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifndef ElementAnimation_h | 31 #ifndef ElementAnimation_h |
| 32 #define ElementAnimation_h | 32 #define ElementAnimation_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/DictionarySequenceOrDictionary.h" | 34 #include "bindings/core/v8/DictionarySequenceOrDictionary.h" |
| 35 #include "core/animation/DocumentTimeline.h" | 35 #include "core/animation/DocumentTimeline.h" |
| 36 #include "core/animation/EffectInput.h" | 36 #include "core/animation/EffectInput.h" |
| 37 #include "core/animation/ElementAnimations.h" | 37 #include "core/animation/ElementAnimations.h" |
| 38 #include "core/animation/KeyframeEffect.h" | 38 #include "core/animation/KeyframeEffect.h" |
| 39 #include "core/animation/KeyframeEffectOptions.h" | 39 #include "core/animation/KeyframeEffectOptions.h" |
| 40 #include "core/animation/KeyframeEffectReadOnly.h" |
| 40 #include "core/animation/TimingInput.h" | 41 #include "core/animation/TimingInput.h" |
| 41 #include "core/dom/Document.h" | 42 #include "core/dom/Document.h" |
| 42 #include "core/dom/Element.h" | 43 #include "core/dom/Element.h" |
| 43 #include "platform/RuntimeEnabledFeatures.h" | 44 #include "platform/RuntimeEnabledFeatures.h" |
| 44 #include "wtf/Allocator.h" | 45 #include "wtf/Allocator.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 class Dictionary; | 49 class Dictionary; |
| 49 | 50 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 102 |
| 102 static HeapVector<Member<Animation>> getAnimations(Element& element) { | 103 static HeapVector<Member<Animation>> getAnimations(Element& element) { |
| 103 HeapVector<Member<Animation>> animations; | 104 HeapVector<Member<Animation>> animations; |
| 104 | 105 |
| 105 if (!element.hasAnimations()) | 106 if (!element.hasAnimations()) |
| 106 return animations; | 107 return animations; |
| 107 | 108 |
| 108 for (const auto& animation : | 109 for (const auto& animation : |
| 109 element.document().timeline().getAnimations()) { | 110 element.document().timeline().getAnimations()) { |
| 110 DCHECK(animation->effect()); | 111 DCHECK(animation->effect()); |
| 111 if (toKeyframeEffect(animation->effect())->target() == element && | 112 if (toKeyframeEffectReadOnly(animation->effect())->target() == element && |
| 112 (animation->effect()->isCurrent() || | 113 (animation->effect()->isCurrent() || |
| 113 animation->effect()->isInEffect())) | 114 animation->effect()->isInEffect())) |
| 114 animations.append(animation); | 115 animations.append(animation); |
| 115 } | 116 } |
| 116 return animations; | 117 return animations; |
| 117 } | 118 } |
| 118 | 119 |
| 119 private: | 120 private: |
| 120 static Animation* animateInternal(Element& element, | 121 static Animation* animateInternal(Element& element, |
| 121 EffectModel* effect, | 122 EffectModel* effect, |
| 122 const Timing& timing) { | 123 const Timing& timing) { |
| 123 KeyframeEffect* keyframeEffect = | 124 KeyframeEffect* keyframeEffect = |
| 124 KeyframeEffect::create(&element, effect, timing); | 125 KeyframeEffect::create(&element, effect, timing); |
| 125 return element.document().timeline().play(keyframeEffect); | 126 return element.document().timeline().play(keyframeEffect); |
| 126 } | 127 } |
| 127 }; | 128 }; |
| 128 | 129 |
| 129 } // namespace blink | 130 } // namespace blink |
| 130 | 131 |
| 131 #endif // ElementAnimation_h | 132 #endif // ElementAnimation_h |
| OLD | NEW |